diff --git a/README.md b/README.md index c2ff42ff2..3a083631d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# API +# Inscrytion API Package + +Hey there, welcome to the API Package, below you can find information about what this package contains, how you can contribute to it, as well as resources for getting started with modding for Inscryption. ## Inscryption API @@ -7,7 +9,7 @@ This plugin is a BepInEx plugin made for Inscryption as an API. This is the de-f It can currently create and modify: - Cards - Abilities -- Appearance behaviours +- Appearance Behaviours - Stat Icons - Challenges - Starter Decks @@ -25,230 +27,153 @@ It can currently create and modify: Additionally, a number of quality-of-life patches from the community are included with each release. -## Getting Started: Installation ---- -To begin, we'll go over how to install BepInEx, the framework all Inscryption mods use. This is a necessary step to playing modded Inscryption, so be sure to follow this carefully. - -**FOR LINUX AND STEAMDECK:** Ensure that the game is set to run using `Proton` in he game settings on steam. Should be a setting like this: `Change launch behaviour` -> `Proton`. - -### Installing with a Mod Manager -1. Download and install [Thunderstore Mod Manager](https://www.overwolf.com/app/Thunderstore-Thunderstore_Mod_Manager), [Gale](https://thunderstore.io/c/inscryption/p/Kesomannen/GaleModManager/), [Pulsar](https://pulsarmods.com/) or [r2modman](https://thunderstore.io/c/inscryption/p/ebkr/r2modman/). -2. Click the **Install with Mod Manager** button on the top of [BepInEx's](https://thunderstore.io/c/inscryption/p/BepInEx/BepInExPack_Inscryption/) page. -3. Run the game via the mod manager. - -If you have issues with Mod Managers head to one of these discords; - -* **Thunderstore Support Discord:** [Here](https://discord.gg/Fbz54kQAxg) -* **R2ModMan Support Discord:** [Here](https://discord.gg/R85wjqa4WN) -* **Gale Mod Manager Support Discord:** [Here](https://discord.gg/sfuWXRfeTt) - -### Installing Manually -1. Install [BepInEx](https://thunderstore.io/package/download/BepInEx/BepInExPack_Inscryption/5.4.2305/) by pressing `Manual Download` and extract the contents into a folder. **Do not extract into the game folder!** -2. Move the contents of the `BepInExPack_Inscryption` folder into the game folder (where the game executable is; usually found here: `C:\Program Files (x86)\Steam\steamapps\common\Inscryption`). -3. Run the game. If everything was done correctly, you will see the BepInEx console appear on your desktop. Close the game after it finishes loading. -4. Install [MonoModLoader](https://inscryption.thunderstore.io/package/BepInEx/MonoMod_Loader_Inscryption/) and extract the contents into a folder. -5. Move the contents of the `patchers` folder into `BepInEx/patchers` (If any of the mentioned BepInEx folders don't exist, just create them). -6. Install [Inscryption API](https://inscryption.thunderstore.io/package/API_dev/API/) and extract the contents into a folder. -7. Move the contents of the `plugins` folder into `BepInEx/plugins` and the contents of the `monomod` folder into the `BepInEx/monomod` folder. -8. Run the game again. If everything runs correctly, a message will appear in the console telling you that the API was loaded. -9. For any additional mods create a new subfolder, it can be called anything and extract the zips archive into it and if there is a `BepInEx` folder within the zip instead drop the contents of that folder into the `BepInEx` root for the modding instance. EX; - ``` - BepInEx // These go within the BepInEx root folder - |-- config - |-- patchers - |-- plugins - |-- monomod - |-- core - plugins // Files within go into the created plugin subfolder that was created for the mod - |-- Art - |-- Scripts - |-- MyMod.dll - manifest.json // Ignorable, but if kept, goes in plugin subfolder - README.md // Ignorable, but if kept, goes in plugin subfolder - CHANGELOG.md // Ignorable, but if kept, goes in plugin subfolder - icon.png // Ignorable, but if kept, goes in plugin subfolder - ``` -10. Run the game once more and everything should be correct and working. - -### Installing Manually (XBOX Game-Pass) -1. Install [BepInEx](https://thunderstore.io/package/download/BepInEx/BepInExPack_Inscryption/5.4.2305/) by pressing `Manual Download` and extract the contents into a folder. **Do not extract into the game folder!** -2. Move the contents of the `BepInExPack_Inscryption` folder into the game folder (where the game executable is; usually found here: `C:\XboxGames\Inscryption\Content`). -3. Install the following package: [XboxSilencio](https://thunderstore.io/c/inscryption/p/CORE_API_TEAM/GamepassSilencio/), this is a package which aims to solve frictions with XBOX Gamepass specific installations, such as HueyFS related errors. -4. Run the game. If everything was done correctly, you will see the BepInEx console appear on your desktop. Close the game after it finishes loading. -5. Install [MonoModLoader](https://inscryption.thunderstore.io/package/BepInEx/MonoMod_Loader_Inscryption/) and extract the contents into a folder. -6. Move the contents of the `patchers` folder into `BepInEx/patchers` (If any of the mentioned BepInEx folders don't exist, just create them). -7. Install [Inscryption API](https://inscryption.thunderstore.io/package/API_dev/API/) and extract the contents into a folder. -8. Move the contents of the `plugins` folder into `BepInEx/plugins` and the contents of the `monomod` folder into the `BepInEx/monomod` folder. -9. Run the game again. If everything runs correctly, a message will appear in the console telling you that the API was loaded. -10. For any additional mods create a new subfolder, it can be called anything and extract the zips archive into it and if there is a `BepInEx` folder within the zip instead drop the contents of that folder into the `BepInEx` root for the modding instance. EX; - ``` - BepInEx // These go within the BepInEx root folder - |-- config - |-- patchers - |-- plugins - |-- monomod - |-- core - plugins // Files within go into the created plugin subfolder that was created for the mod - |-- Art - |-- Scripts - |-- MyMod.dll - manifest.json // Ignorable, but if kept, goes in plugin subfolder - README.md // Ignorable, but if kept, goes in plugin subfolder - CHANGELOG.md // Ignorable, but if kept, goes in plugin subfolder - icon.png // Ignorable, but if kept, goes in plugin subfolder - ``` -11. Run the game once more and everything should be correct and working. - -### Installing on the Steam Deck -1. Download [r2modman](https://thunderstore.io/c/inscryption/p/ebkr/r2modman/) on the Steam Deck's Desktop Mode and open it from its download using its `AppImage` file. -2. Download the mods you plan on using and their dependencies. -3. Go to the setting of the profile you are using for the mods and click `Browse Profile Folder`. -4. Copy the BepInEx folder, then go to Steam and open Inscryption's Properties menu -5. Go to `Installed Files` click `Browse` to open the folder containing Inscryption's local files; paste the BepInEx folder there. -6. Enter Gaming Mode and check 'Force the use of a specific Steam Play compatibility tool' in the Properties menu under `Compatibility`. -7. Go to the launch parameters and enter `WINEDLLOVERRIDES="winhttp.dll=n,b" %command%`. -8. Open Inscryption. If everything was done correctly, you should see a console appear on your screen. - -### Mac & Linux -1. Follow the steps here first: -2. Next do steps 4-10 of the Manual Installation -3. Your game should be setup for inscryption modding now - -If you have any issues with Mac/Linux, Steam Deck, or Manual head over to the discord for this game: - -* **Inscryption Modding Discord:** [Here](https://discord.gg/ZQPvfKEpwM) - -## Getting Started: Modding ---- -Modding Inscryption requires a knowledge of coding in C#, and in many cases an understanding of how to patch the game using HarmonyPatch. - -If you're unfamiliar with any of this, or just want to create cards and sigils, you can use [JSONLoader](https://inscryption.thunderstore.io/package/MADH95Mods/JSONCardLoader/). - -### Modding with JSONLoader - JSONLoader is a versatile mode that provides a more beginner-friendly way of creating new cards and abilities for Inscryption using JSON syntax, which is much simpler than C#. - -JSONLoader's documentation can be found [here](https://github.com/MADH95/JSONLoader). - -A video tutorial covering how to use JSONLoader in a basic form can be found [here](https://www.youtube.com/watch?v=grTSkpI4U7g). - -### Modding with C# -To begin modding with C#, you will need to create a new C# project using a code editor. -We recommend and assume you're using Microsoft's Visual Studio. - -Your project's target framework needs to be `netstandard2.0`. - -Once your project's created, go to `Project > Manage NuGet Packages`. -Click the dropdown menu for 'Package source' and check that 'BepInEx' and 'nuget' is there. - -If BepInEx or nuget aren't an available source, we need to add them. -To add a new package source, click on the gear icon next to the package source selector, then click the large green plus-sign. - -To add BepInEx, change the name to 'BepInEx' and the source link to 'https://nuget.bepinex.dev/v3/index.json'. -To add nuget, change the name to 'nuget' and the source link to 'https://nuget.windows10ce.com/nuget/v3/index.json'. - -Change the package source to 'All' then click 'Browse'. -We want to install the following packages (**Make sure the version numbers match!**): -- BepInEx.Analyzers v1.0.8 -- BepInEx.Core v5.4.19 -- HarmonyX v2.9.0 -- Inscryption.GameLibs v1.9.0-r.0 -- UnityEngine.Modules v2019.4.24 - -You will also need to add the API as a reference. -There are a couple ways to do this, detailed below; whichever way you choose to do this, you'll also need to need to reference `InscryptionAPI.dll`, which should be in your BepInEx plugins folder; copy this path for future use. - -To do so, go to your 'BepInEx/plugins' folder and copy the folder path. -Then, navigate to `Project > Add Project Reference` and click 'Browse'. -Copy the folder path and add 'InscryptionAPI.dll' as a reference. -You can do this for other mods' .dll files if you want to reference them as a mod dependency (a separate mod that your mod relies on to work). - -An alternative method to adding the API (and other mods) as a reference is to use NuGet packages by adding 'https://nuget.bepinex.dev/v3/index.json' as a package source, and then adding 'API_dev-API' as a reference. - -With all this, you are now ready to begin creating your mod! -Some resources are provided below for you to use, including an example mod to look at for examples. -Otherwise, continue reading this wiki. +___ -### Modding Resources -[Inscryption Modding Discord](https://discord.gg/QrJEF5Denm) +## Getting Started (Users) + +The following are links to articles relevant for Users of the API. Namely covering the topic of installation of mods for Inscryption that utilize the API. This also includes how to install BepInEx, the underlying framework for all Inscryption Mods, for all the given scenarios the Articles tackle. + +***FOR LINUX AND STEAMDECK:*** Ensure that the game is set to run using `Proton` in the game settings on steam. Should be a setting like this: `Change launch behaviour` -> `Proton`. + +* [Installing With a Mod Manager](https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/users/installing_with_a_mod_manager.html) +* [Installing Manually on Windows (x86)](https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/users/installing_manually_on_windows_x86.html) +* [Installing Manually on Windows (x64)](https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/users/installing_manually_on_windows_x64.html) +* [Installing on The Steam Deck](https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/users/installing_on_the_steam_deck.html) +* [Installing on Mac & Linux](https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/users/installing_on_mac_and_linux.html) + +___ + +## Getting Started (Modders) + +So your interested in learning how to modify Inscryption? Well this section of our guide should come in really handy for you! Albeit if your an artist, a developer, or just passing by, we hope you find these guides of value. + +First off let's get you to the right branch of the guides. Let's get some groundwork's out of the way now. Based on the item below, you should be funneled to the level your after. *Note for the IDE Question, if you have familiarity with [IntelliJ Idea](https://www.jetbrains.com/idea/), you'll likely prefer JetBrains Rider.* + +```mermaid +flowchart TD + A["Are you trying to make a Simple Cardpack?"] + A --> A1["If this item applied to you, than let's head to the
~~ JSONLoader Branch ~~
Unless your willing to challenge yourself?
If you want the challenge, follow the other tree!"] -[BepInEx documentation](https://docs.bepinex.dev/) + B["Are you after something more Complex in terms of your Project?"] + B --> C["Are you already familiar with C#?"] -[Harmony patching article](https://harmony.pardeike.net/articles/patching.html) + C -->|Yes| D["What is your preferred of the two? Visual Studio, or JetBrains Rider?"] + C -->|No| C1["If this was your case, than let's head into the
~~ C# Basics Branch ~~
To get you familiar with the underlying concepts,
and knowledge you will need in order to make your mod."] -[Example Mod using C#](https://github.com/debugman18/InscryptionExampleMod) + D -->|Visual Studio| D1["If this was your choice, let us navigate into the
~~ API Project Setup Guide for Visual Studio ~~"] + D -->|JetBrains Rider| D2["If this was your choice, let us navigate into the
~~ API Project Setup Guide for JetBrains Rider ~~"] -[Vanilla and Modded Enumerations](https://github.com/SaxbyMod/SabyModEnums) + click A1 "https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/modders/jsonloader_projects/index.html" "Open JSONLoader Branch" + click C1 "https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/modders/c_sharp_basics/index.html" "Open C# Basics Branch" + click D1 "https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/modders/api_projects_vs_edition/index.html" "Open Visual Studio Setup Guide" + click D2 "https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/modders/api_projects_rider_edition/index.html" "Open JetBrains Rider Setup Guide" +``` -An example mod utilising this plugin can be found [here](https://github.com/debugman18/InscryptionExampleMod), -and the modding wiki and documentation can be found [here](https://inscryptionmodding.github.io/InscryptionAPI/wiki/index.html). +
+ +Plain-Text Version + + +1. Are you trying to make a Simple Cardpack? + - If this item applied to you, than let's head to the [JSONLoader Branch](https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/modders/jsonloader_projects/index.html) Unless your willing to challenge yourself? +2. Are you after something more Complex in terms of your Project? + 1. Are you already familiar with C#? + * If `Yes` was your choice: + 1. What is your preferred of the two? Visual Studio, or JetBrains Rider? + * If `Visual Studio` was your choice: + - If this was your choice, let us navigate into the [API Project Setup Guide for Visual Studio](https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/modders/api_projects_vs_edition/index.html). + * If `JetBrains Rider` was your choice: + - If this was your choice, let us navigate into the [API Project Setup Guide for JetBrains Rider](https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/modders/api_projects_rider_edition/index.html). + * If `No` was your choice: + - If this was your case, than let's head into the [C# Basics Branch](https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/modders/c_sharp_basics/index.html), to get you familiar with the underlying concepts and knowledge you will need in order to make your mod. + +
+ +### Modding Resources +- [Inscryption Modding Discord](https://discord.gg/QrJEF5Denm) +- [Inscryption Modding Wiki](https://inscryptionmodding.github.io/InscryptionAPI/wiki/) +- [BepInEx documentation](https://docs.bepinex.dev/) +- [Harmony patching article](https://harmony.pardeike.net/articles/patching.html) +- [Example Mod using C#](https://github.com/debugman18/InscryptionExampleMod) +- [Vanilla and Modded Enumerations](https://github.com/SaxbyMod/SabyModEnums) + +___ ## Modded Save File -With this API installed, an additional 'modded save file' will be created by the game. This file will be found in the 'BepInEx' subdirectory, and contains all save data created by mods that use this API. This file will not automatically be synced to the cloud by Steam. +With this API installed, an additional `ModdedSaveFile.gwsave` will be created by the game. This file will be found in the `BepInEx` subdirectory, and contains all save data created by mods that use this API. This file will not automatically be synced to the cloud by Steam. -# Community Patches +___ + +## Community Patches The following patches from the Inscryption modding community have been included in this package to improve the overall quality-of-life for modding and compatibility. -## SigilArtPatch by MADH95Mods +### SigilArtPatch by MADH95Mods Fixes the art for abilities that previously only appeared in Act 2 so they appear correctly in Act 1 and Act 3 -## Conduit Attack Fix by MADH95Mods +### Conduit Attack Fix by MADH95Mods Fixes the behavior of conduits so they function correctly in Act 1. -## Activated Sigil Fix by MADH95Mods +### Activated Sigil Fix by MADH95Mods Allows activated sigils to work correctly in Act 1 and Act 3 by clicking the sigil icon on the card. -## AnthonysLatchFix by AnthonyPython +### AnthonysLatchFix by AnthonyPython Fixes latch sigils to work in Act 1 -## Sigil Art Fix by Memez4Life +### Sigil Art Fix by Memez4Life Allows up to 8 sigils to be displayed on cards and adds the option to display merged sigil stamps at the bottom of the card instead of over the artwork (see the config files for more information). -## Visually Stackable Sigils by divisionbyz0rro +### Visually Stackable Sigils by divisionbyz0rro Combines multiple instances of the same sigil on a single card into a single sigil with a number to free up space on the card. -## Cost Render Fix by Void Slime +### Cost Render Fix by Void Slime Displays hybrid cost cards correctly and makes energy and mox show up on act 1 cards -## Cost Choice Node fix by Void Slime +### Cost Choice Node Fix by Void Slime If energy/mox cards are in the Act 1 pool, energy and mox card choice nodes will be added to the cost choice node in Act 1. -## Sniper Sigil Fix by SpecialAPI +### Sniper Sigil Fix by SpecialAPI Displays targets for attacks made with the sniper sigil in Act 1. -## Act 1 Sentry Fixes by WhistleWind +### Act 1 Sentry Fixes by WhistleWind Fixes a number of bugs caused by the Sentry ability being used in Act 1. -## Multi-Act Sigil Compatibility Fixes by WhistleWind +### Multi-Act Sigil Compatibility Fixes by WhistleWind Fixes a number of sigils to be usable in all Acts. Sigils include: Mental Gemnastics, Tidal Lock, Hoarder, Vessel Printer, Amorphous, Handy. -## Fledgling Sigil Fixes by WhistleWind +### Fledgling Sigil Fixes by WhistleWind Fixes Fledgling in Act 2 to show the correct number of turns until a card evolves, up to 3. Also changes its description to show the correct number of turns. -## OverridePixelAbilityIcons by WhistleWind +### OverridePixelAbilityIcons by WhistleWind Fixes the OverrideAbilityIcon method to work in Act 2. -## Temporary Mod Fixes by WhistleWind -- Fixes issues related to using temporary mods in Act 2 or to add custom decals +### Temporary Mod Fixes by WhistleWind +Fixes issues related to using temporary mods in Act 2 or to add custom decals + +___ -# Using the API +## Using the API -Inscryption API 2.0 tries to have you use the original game's objects as much as possible. For example, there are no more 'NewCard' and 'CustomCard' objects; instead, you are responsible to create CardInfo objects yourself and add them. +Inscryption API 2.0 tries to have you use the original game's objects as much as possible. For example, there are no more `NewCard` and `CustomCard` objects; instead, you are responsible to create `CardInfo` objects yourself and add them. The API does provide a number of helper methods to make this process simpler for you. For more information, please check out the wiki: [Here](https://inscryptionmodding.github.io/InscryptionAPI/wiki/), and if you need any help with anything related to the API send a message over in [Inscryption Modding Discord](https://discord.gg/QrJEF5Denm). +___ + ## Contribution -### How can you help? -Use the plugin and report bugs you find! Ping us on the [Inscryption Modding Discord](https://discord.gg/QrJEF5Denm) server in the api channel with what you find. +### How Can You Help? +Use the plugin and report bugs you find! Ping us on the [Inscryption Modding Discord](https://discord.gg/QrJEF5Denm) server in the `api-help` channel with what you find. -### But really, I want to help develop this mod! +### But Really, I Want to Help Develop This Mod! Great! We're more than happy to accept help. Either make a pull request to the API's [GitHub page](https://github.com/InscryptionModding/InscryptionAPI) or come join us over in the [Inscryption Modding Discord](https://discord.gg/QrJEF5Denm). -### Can I donate? +### Can I Donate? Donations are totally not needed, this is a passion project before anything else. +___ + ## Contributors Original version by cyantist @@ -268,4 +193,4 @@ Contributors and builders of API 2.0: - Keks307 - Creator/Chaosyr/SaxbyMod/The Stoat Lord/ThinCreator3483 - stillrinny -- R3b00t3d-kawaii +- R3b00t3d-kawaii \ No newline at end of file diff --git a/docs/docfx.json b/docs/docfx.json index b22927779..0e49ca97d 100644 --- a/docs/docfx.json +++ b/docs/docfx.json @@ -58,7 +58,7 @@ "files": ["community/**.yml", "community/index.md"] }, { - "files": ["wiki/toc.yml", "wiki/**.md"] + "files": ["wiki/toc.yml", "wiki/**.md", "wiki/**.yml"] }, { "files": ["toc.yml", "index.md"] diff --git a/docs/index.md b/docs/index.md index bab349348..8404200b3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,5 @@ # Inscryption API Wiki ---- + Hey there, and welcome to the Inscryption Modding and API Wiki. This is your one stop hub for all things related to the API. The following are some quick links: * [Inscryption API Documentation](api/index.md) @@ -11,7 +11,7 @@ Some other links you may find extremely valuable are as follows: * [Thunderstore Package](https://thunderstore.io/c/inscryption/p/API_dev/API/) * [GitHub Repository](https://github.com/InscryptionModding/InscryptionAPI) -How can you contribute to the wiki? Well for starters you can find the Wiki end of our setup [here](https://github.com/InscryptionModding/InscryptionAPI/tree/main/docs), the only relevant part of this setup you may need to interact with is `wiki` or any `index.md` files. The rest of it leave untouched unless you ***know*** what you are doing. Once you have a markdown file open its straight forward editing as long as you know how Markdown works. +How can you contribute to the wiki? Well for starters you can find the Wiki end of our setup [here](https://github.com/InscryptionModding/InscryptionAPI/tree/main/docs), the only relevant part of this setup you may need to interact with is `wiki` or any `index.md` files. The rest of it leave untouched unless you ***know*** what you are doing. Once you have a Markdown file open its straightforward editing as long as you know how Markdown works. ___ @@ -22,7 +22,7 @@ This plugin is a BepInEx plugin made for Inscryption as an API. This is the de-f It can currently create and modify: - Cards - Abilities -- Appearance behaviours +- Appearance Behaviours - Stat Icons - Challenges - Starter Decks @@ -42,167 +42,58 @@ Additionally, a number of quality-of-life patches from the community are include ___ -## Getting Started: Installation ---- -To begin, we'll go over how to install BepInEx, the framework all Inscryption mods use. This is a necessary step to playing modded Inscryption, so be sure to follow this carefully. - -**FOR LINUX AND STEAMDECK:** Ensure that the game is set to run using `Proton` in he game settings on steam. Should be a setting like this: `Change launch behaviour` -> `Proton`. - -### Installing with a Mod Manager -1. Download and install [Thunderstore Mod Manager](https://www.overwolf.com/app/Thunderstore-Thunderstore_Mod_Manager), [Gale](https://thunderstore.io/c/inscryption/p/Kesomannen/GaleModManager/), [Pulsar](https://pulsarmods.com/) or [r2modman](https://thunderstore.io/c/inscryption/p/ebkr/r2modman/). -2. Click the **Install with Mod Manager** button on the top of [BepInEx's](https://thunderstore.io/c/inscryption/p/BepInEx/BepInExPack_Inscryption/) page. -3. Run the game via the mod manager. - -If you have issues with Mod Managers head to one of these discords; - -* **Thunderstore Support Discord:** [Here](https://discord.gg/Fbz54kQAxg) -* **R2ModMan Support Discord:** [Here](https://discord.gg/R85wjqa4WN) -* **Gale Mod Manager Support Discord:** [Here](https://discord.gg/sfuWXRfeTt) - -### Installing Manually -1. Install [BepInEx](https://thunderstore.io/package/download/BepInEx/BepInExPack_Inscryption/5.4.2305/) by pressing `Manual Download` and extract the contents into a folder. **Do not extract into the game folder!** -2. Move the contents of the `BepInExPack_Inscryption` folder into the game folder (where the game executable is; usually found here: `C:\Program Files (x86)\Steam\steamapps\common\Inscryption`). -3. Run the game. If everything was done correctly, you will see the BepInEx console appear on your desktop. Close the game after it finishes loading. -4. Install [MonoModLoader](https://inscryption.thunderstore.io/package/BepInEx/MonoMod_Loader_Inscryption/) and extract the contents into a folder. -5. Move the contents of the `patchers` folder into `BepInEx/patchers` (If any of the mentioned BepInEx folders don't exist, just create them). -6. Install [Inscryption API](https://inscryption.thunderstore.io/package/API_dev/API/) and extract the contents into a folder. -7. Move the contents of the `plugins` folder into `BepInEx/plugins` and the contents of the `monomod` folder into the `BepInEx/monomod` folder. -8. Run the game again. If everything runs correctly, a message will appear in the console telling you that the API was loaded. -9. For any additional mods create a new subfolder, it can be called anything and extract the zips archive into it and if there is a `BepInEx` folder within the zip instead drop the contents of that folder into the `BepInEx` root for the modding instance. EX; - ``` - BepInEx // These go within the BepInEx root folder - |-- config - |-- patchers - |-- plugins - |-- monomod - |-- core - plugins // Files within go into the created plugin subfolder that was created for the mod - |-- Art - |-- Scripts - |-- MyMod.dll - manifest.json // Ignorable, but if kept, goes in plugin subfolder - README.md // Ignorable, but if kept, goes in plugin subfolder - CHANGELOG.md // Ignorable, but if kept, goes in plugin subfolder - icon.png // Ignorable, but if kept, goes in plugin subfolder - ``` -10. Run the game once more and everything should be correct and working. - -### Installing Manually (XBOX Game-Pass) -1. Install [BepInEx](https://thunderstore.io/package/download/BepInEx/BepInExPack_Inscryption/5.4.2305/) by pressing `Manual Download` and extract the contents into a folder. **Do not extract into the game folder!** -2. Move the contents of the `BepInExPack_Inscryption` folder into the game folder (where the game executable is; usually found here: `C:\XboxGames\Inscryption\Content`). -3. Install the following package: [XboxSilencio](https://thunderstore.io/c/inscryption/p/CORE_API_TEAM/GamepassSilencio/), this is a package which aims to solve frictions with XBOX Gamepass specific installations, such as HueyFS related errors. -4. Run the game. If everything was done correctly, you will see the BepInEx console appear on your desktop. Close the game after it finishes loading. -5. Install [MonoModLoader](https://inscryption.thunderstore.io/package/BepInEx/MonoMod_Loader_Inscryption/) and extract the contents into a folder. -6. Move the contents of the `patchers` folder into `BepInEx/patchers` (If any of the mentioned BepInEx folders don't exist, just create them). -7. Install [Inscryption API](https://inscryption.thunderstore.io/package/API_dev/API/) and extract the contents into a folder. -8. Move the contents of the `plugins` folder into `BepInEx/plugins` and the contents of the `monomod` folder into the `BepInEx/monomod` folder. -9. Run the game again. If everything runs correctly, a message will appear in the console telling you that the API was loaded. -10. For any additional mods create a new subfolder, it can be called anything and extract the zips archive into it and if there is a `BepInEx` folder within the zip instead drop the contents of that folder into the `BepInEx` root for the modding instance. EX; - ``` - BepInEx // These go within the BepInEx root folder - |-- config - |-- patchers - |-- plugins - |-- monomod - |-- core - plugins // Files within go into the created plugin subfolder that was created for the mod - |-- Art - |-- Scripts - |-- MyMod.dll - manifest.json // Ignorable, but if kept, goes in plugin subfolder - README.md // Ignorable, but if kept, goes in plugin subfolder - CHANGELOG.md // Ignorable, but if kept, goes in plugin subfolder - icon.png // Ignorable, but if kept, goes in plugin subfolder - ``` -11. Run the game once more and everything should be correct and working. - -### Installing on the Steam Deck -1. Download [r2modman](https://thunderstore.io/c/inscryption/p/ebkr/r2modman/) on the Steam Deck's Desktop Mode and open it from its download using its `AppImage` file. -2. Download the mods you plan on using and their dependencies. -3. Go to the setting of the profile you are using for the mods and click `Browse Profile Folder`. -4. Copy the BepInEx folder, then go to Steam and open Inscryption's Properties menu -5. Go to `Installed Files` click `Browse` to open the folder containing Inscryption's local files; paste the BepInEx folder there. -6. Enter Gaming Mode and check 'Force the use of a specific Steam Play compatibility tool' in the Properties menu under `Compatibility`. -7. Go to the launch parameters and enter `WINEDLLOVERRIDES="winhttp.dll=n,b" %command%`. -8. Open Inscryption. If everything was done correctly, you should see a console appear on your screen. - -### Mac & Linux -1. Follow the steps here first: -2. Next do steps 4-10 of the Manual Installation -3. Your game should be setup for inscryption modding now - -If you have any issues with Mac/Linux, Steam Deck, or Manual head over to the discord for this game: - -* **Inscryption Modding Discord:** [Here](https://discord.gg/ZQPvfKEpwM) - -## Getting Started: Modding ---- -Modding Inscryption requires a knowledge of coding in C#, and in many cases an understanding of how to patch the game using HarmonyPatch. - -If you're unfamiliar with any of this, or just want to create cards and sigils, you can use [JSONLoader](https://inscryption.thunderstore.io/package/MADH95Mods/JSONCardLoader/). - -### Modding with JSONLoader -JSONLoader is a versatile mod that provides a more beginner-friendly way of creating new cards and abilities for Inscryption using JSON syntax, which is much simpler than C#. - -JSONLoader's documentation can be found [here](https://github.com/MADH95/JSONLoader). - -A video tutorial covering how to use JSONLoader in a basic form can be found [here](https://www.youtube.com/watch?v=grTSkpI4U7g). - -### Modding with C# -To begin modding with C#, you will need to create a new C# project using a code editor. -We recommend and assume you're using Microsoft's Visual Studio. - -Your project's target framework needs to be `netstandard2.0`. - -Once your project's created, go to `Project > Manage NuGet Packages`. -Click the dropdown menu for 'Package source' and check that 'BepInEx' and 'nuget' is there. - -If BepInEx or nuget aren't an available source, we need to add them. -To add a new package source, click on the gear icon next to the package source selector, then click the large green plus-sign. - -To add BepInEx, change the name to 'BepInEx' and the source link to 'https://nuget.bepinex.dev/v3/index.json'. -To add nuget, change the name to 'nuget' and the source link to 'https://nuget.windows10ce.com/nuget/v3/index.json'. - -Change the package source to 'All' then click 'Browse'. -We want to install the following packages (**Make sure the version numbers match!**): -- BepInEx.Analyzers v1.0.8 -- BepInEx.Core v5.4.19 -- HarmonyX v2.9.0 -- Inscryption.GameLibs v1.9.0-r.0 -- UnityEngine.Modules v2019.4.24 - -You will also need to add the API as a reference. -There are a couple ways to do this, detailed below; whichever way you choose to do this, you'll also need to need to reference `InscryptionAPI.dll`, which should be in your BepInEx plugins folder; copy this path for future use. - -To do so, go to your 'BepInEx/plugins' folder and copy the folder path. -Then, navigate to `Project > Add Project Reference` and click 'Browse'. -Copy the folder path and add 'InscryptionAPI.dll' as a reference. -You can do this for other mods' .dll files if you want to reference them as a mod dependency (a separate mod that your mod relies on to work). - -An alternative method to adding the API (and other mods) as a reference is to use NuGet packages by adding 'https://nuget.bepinex.dev/v3/index.json' as a package source, and then adding 'API_dev-API' as a reference. - -With all this, you are now ready to begin creating your mod! -Some resources are provided below for you to use, including an example mod to look at for examples. -Otherwise, continue reading this wiki. +## Getting Started (Users) -### Modding Resources -[Inscryption Modding Discord](https://discord.gg/QrJEF5Denm) +The following are links to articles relevant for Users of the API. Namely covering the topic of installation of mods for Inscryption that utilize the API. This also includes how to install BepInEx, the underlying framework for all Inscryption Mods, for all the given scenarios the Articles tackle. + +***FOR LINUX AND STEAMDECK:*** Ensure that the game is set to run using `Proton` in the game settings on steam. Should be a setting like this: `Change launch behaviour` -> `Proton`. + +* [Installing With a Mod Manager](https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/users/installing_with_a_mod_manager.html) +* [Installing Manually on Windows (x86)](https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/users/installing_manually_on_windows_x86.html) +* [Installing Manually on Windows (x64)](https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/users/installing_manually_on_windows_x64.html) +* [Installing on The Steam Deck](https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/users/installing_on_the_steam_deck.html) +* [Installing on Mac & Linux](https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/users/installing_on_mac_and_linux.html) + +___ + +## Getting Started (Modders) + +So your interested in learning how to modify Inscryption? Well this section of our guide should come in really handy for you! Albeit if your an artist, a developer, or just passing by, we hope you find these guides of value. + +First off let's get you to the right branch of the guides. Let's get some groundwork's out of the way now. Based on the item below, you should be funneled to the level your after. *Note for the IDE Question, if you have familiarity with [IntelliJ Idea](https://www.jetbrains.com/idea/), you'll likely prefer JetBrains Rider.* -[BepInEx documentation](https://docs.bepinex.dev/) +```mermaid +flowchart TD + A["Are you trying to make a Simple Cardpack?"] + A --> A1["If this item applied to you, than let's head to the
~~ JSONLoader Branch ~~
Unless your willing to challenge yourself?
If you want the challenge, follow the other tree!"] -[Harmony patching article](https://harmony.pardeike.net/articles/patching.html) + B["Are you after something more Complex in terms of your Project?"] + B --> C["Are you already familiar with C#?"] -[Example Mod using C#](https://github.com/debugman18/InscryptionExampleMod) + C -->|Yes| D["What is your preferred of the two? Visual Studio, or JetBrains Rider?"] + C -->|No| C1["If this was your case, than let's head into the
~~ C# Basics Branch ~~
To get you familiar with the underlying concepts,
and knowledge you will need in order to make your mod."] -[Vanilla and Modded Enumerations](https://github.com/SaxbyMod/SabyModEnums) + D -->|Visual Studio| D1["If this was your choice, let us navigate into the
~~ API Project Setup Guide for Visual Studio ~~"] + D -->|JetBrains Rider| D2["If this was your choice, let us navigate into the
~~ API Project Setup Guide for JetBrains Rider ~~"] -An example mod utilising this plugin can be found [here](https://github.com/debugman18/InscryptionExampleMod), -and the modding wiki and documentation can be found [here](https://inscryptionmodding.github.io/InscryptionAPI/wiki/index.html). + click A1 "https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/modders/jsonloader_projects/index.html" "Open JSONLoader Branch" + click C1 "https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/modders/c_sharp_basics/index.html" "Open C# Basics Branch" + click D1 "https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/modders/api_projects_vs_edition/index.html" "Open Visual Studio Setup Guide" + click D2 "https://inscryptionmodding.github.io/InscryptionAPI/wiki/getting_started/modders/api_projects_rider_edition/index.html" "Open JetBrains Rider Setup Guide" +``` + +### Modding Resources +- [Inscryption Modding Discord](https://discord.gg/QrJEF5Denm) +- [Inscryption Modding Wiki](https://inscryptionmodding.github.io/InscryptionAPI/wiki/) +- [BepInEx documentation](https://docs.bepinex.dev/) +- [Harmony patching article](https://harmony.pardeike.net/articles/patching.html) +- [Example Mod using C#](https://github.com/debugman18/InscryptionExampleMod) +- [Vanilla and Modded Enumerations](https://github.com/SaxbyMod/SabyModEnums) ___ ## Modded Save File -With this API installed, an additional 'modded save file' will be created by the game. This file will be found in the 'BepInEx' subdirectory, and contains all save data created by mods that use this API. This file will not automatically be synced to the cloud by Steam. +With this API installed, an additional `ModdedSaveFile.gwsave` will be created by the game. This file will be found in the `BepInEx` subdirectory, and contains all save data created by mods that use this API. This file will not automatically be synced to the cloud by Steam. ___ @@ -230,7 +121,7 @@ Combines multiple instances of the same sigil on a single card into a single sig ### Cost Render Fix by Void Slime Displays hybrid cost cards correctly and makes energy and mox show up on act 1 cards -### Cost Choice Node fix by Void Slime +### Cost Choice Node Fix by Void Slime If energy/mox cards are in the Act 1 pool, energy and mox card choice nodes will be added to the cost choice node in Act 1. ### Sniper Sigil Fix by SpecialAPI @@ -249,19 +140,29 @@ Fixes Fledgling in Act 2 to show the correct number of turns until a card evolve Fixes the OverrideAbilityIcon method to work in Act 2. ### Temporary Mod Fixes by WhistleWind -- Fixes issues related to using temporary mods in Act 2 or to add custom decals +Fixes issues related to using temporary mods in Act 2 or to add custom decals + +___ + +## Using the API + +Inscryption API 2.0 tries to have you use the original game's objects as much as possible. For example, there are no more `NewCard` and `CustomCard` objects; instead, you are responsible to create `CardInfo` objects yourself and add them. + +The API does provide a number of helper methods to make this process simpler for you. + +For more information, please check out the wiki: [Here](https://inscryptionmodding.github.io/InscryptionAPI/wiki/), and if you need any help with anything related to the API send a message over in [Inscryption Modding Discord](https://discord.gg/QrJEF5Denm). ___ ## Contribution -### How can you help? -Use the plugin and report bugs you find! Ping us on the [Inscryption Modding Discord](https://discord.gg/QrJEF5Denm) server in the api channel with what you find. +### How Can You Help? +Use the plugin and report bugs you find! Ping us on the [Inscryption Modding Discord](https://discord.gg/QrJEF5Denm) server in the `api-help` channel with what you find. -### But really, I want to help develop this mod! +### But Really, I Want to Help Develop This Mod! Great! We're more than happy to accept help. Either make a pull request to the API's [GitHub page](https://github.com/InscryptionModding/InscryptionAPI) or come join us over in the [Inscryption Modding Discord](https://discord.gg/QrJEF5Denm). -### Can I donate? +### Can I Donate? Donations are totally not needed, this is a passion project before anything else. ___ diff --git a/docs/template/api_wiki/layout/_master.tmpl b/docs/template/api_wiki/layout/_master.tmpl index c5cbedd63..d9ca91b1c 100644 --- a/docs/template/api_wiki/layout/_master.tmpl +++ b/docs/template/api_wiki/layout/_master.tmpl @@ -115,6 +115,16 @@ const availableFonts = [ 'dpcomic', + '04b', + 'crumbled-pixels', + 'daggersquare', + 'daggersquare-oblique', + 'garbageschrift', + 'heavyweight', + 'mail-ray-stuff', + 'marksman', + 'pony-island', + 'portmanteau', 'comic-sans', 'sans-serif', 'monospace', @@ -253,6 +263,16 @@ + + + + + + + + + + @@ -315,6 +345,55 @@ > +
+ + + +
+ +
+ + +
+ +
+ + +
+
-
-
@@ -589,6 +717,36 @@ min: 12, max: 32 }, + { + id: 'document-line-height', + output: 'document-line-height-value', + storage: 'docfx-document-line-height', + property: '--document-line-height', + unit: '', + defaultValue: 1.2, + min: 1, + max: 2.5 + }, + { + id: 'document-letter-spacing', + output: 'document-letter-spacing-value', + storage: 'docfx-document-letter-spacing', + property: '--document-letter-spacing', + unit: 'px', + defaultValue: 1, + min: -5, + max: 10 + }, + { + id: 'document-word-spacing', + output: 'document-word-spacing-value', + storage: 'docfx-document-word-spacing', + property: '--document-word-spacing', + unit: 'px', + defaultValue: 0.9, + min: -5, + max: 20 + }, { id: 'code-font-size', output: 'code-font-size-value', @@ -599,35 +757,65 @@ min: 10, max: 28 }, - { - id: 'document-line-height', - output: 'document-line-height-value', - storage: 'docfx-document-line-height', - property: '--document-line-height', - unit: '', - defaultValue: 1.5, - min: 1, - max: 2.5 - }, { id: 'code-line-height', output: 'code-line-height-value', storage: 'docfx-code-line-height', property: '--code-line-height', unit: '', - defaultValue: 1.4, + defaultValue: 1.2, min: 1, max: 2.5 }, + { + id: 'code-letter-spacing', + output: 'code-letter-spacing-value', + storage: 'docfx-code-letter-spacing', + property: '--code-letter-spacing', + unit: 'px', + defaultValue: 1, + min: -5, + max: 10 + }, + { + id: 'code-word-spacing', + output: 'code-word-spacing-value', + storage: 'docfx-code-word-spacing', + property: '--code-word-spacing', + unit: 'px', + defaultValue: 0.9, + min: -5, + max: 20 + }, { id: 'heading-line-height', output: 'heading-line-height-value', storage: 'docfx-heading-line-height', property: '--heading-line-height', unit: '', - defaultValue: 1.2, + defaultValue: 1.0, min: 1, max: 2 + }, + { + id: 'heading-letter-spacing', + output: 'heading-letter-spacing-value', + storage: 'docfx-heading-letter-spacing', + property: '--heading-letter-spacing', + unit: 'px', + defaultValue: 1, + min: -5, + max: 10 + }, + { + id: 'heading-word-spacing', + output: 'heading-word-spacing-value', + storage: 'docfx-heading-word-spacing', + property: '--heading-word-spacing', + unit: 'px', + defaultValue: 0.9, + min: -5, + max: 20 } ]; @@ -741,7 +929,13 @@ 'docfx-code-font-size', 'docfx-document-line-height', 'docfx-code-line-height', - 'docfx-heading-line-height' + 'docfx-document-letter-spacing', + 'docfx-document-word-spacing', + 'docfx-code-letter-spacing', + 'docfx-code-word-spacing', + 'docfx-heading-line-height', + 'docfx-heading-letter-spacing', + 'docfx-heading-word-spacing' ]; keys.forEach(key => localStorage.removeItem(key)); diff --git a/docs/template/api_wiki/public/fonts/04B_30__.ttf b/docs/template/api_wiki/public/fonts/04B_30__.ttf new file mode 100644 index 000000000..d3939bb6b Binary files /dev/null and b/docs/template/api_wiki/public/fonts/04B_30__.ttf differ diff --git a/docs/template/api_wiki/public/fonts/Crumbled-Pixels.ttf b/docs/template/api_wiki/public/fonts/Crumbled-Pixels.ttf new file mode 100644 index 000000000..de74fb1cd Binary files /dev/null and b/docs/template/api_wiki/public/fonts/Crumbled-Pixels.ttf differ diff --git a/docs/template/api_wiki/public/fonts/DAGGERSQUARE OBLIQUE.otf b/docs/template/api_wiki/public/fonts/DAGGERSQUARE OBLIQUE.otf new file mode 100644 index 000000000..3242a67ee Binary files /dev/null and b/docs/template/api_wiki/public/fonts/DAGGERSQUARE OBLIQUE.otf differ diff --git a/docs/template/api_wiki/public/fonts/DAGGERSQUARE.otf b/docs/template/api_wiki/public/fonts/DAGGERSQUARE.otf new file mode 100644 index 000000000..a0326faec Binary files /dev/null and b/docs/template/api_wiki/public/fonts/DAGGERSQUARE.otf differ diff --git a/docs/template/api_wiki/public/fonts/DPComic_Extended.otf b/docs/template/api_wiki/public/fonts/DPComic_Extended.otf new file mode 100644 index 000000000..7f76a9860 Binary files /dev/null and b/docs/template/api_wiki/public/fonts/DPComic_Extended.otf differ diff --git a/docs/template/api_wiki/public/fonts/GARBAGES.TTF b/docs/template/api_wiki/public/fonts/GARBAGES.TTF new file mode 100644 index 000000000..182d7c1b3 Binary files /dev/null and b/docs/template/api_wiki/public/fonts/GARBAGES.TTF differ diff --git a/docs/template/api_wiki/public/fonts/Marksman.otf b/docs/template/api_wiki/public/fonts/Marksman.otf new file mode 100644 index 000000000..2f35345ab Binary files /dev/null and b/docs/template/api_wiki/public/fonts/Marksman.otf differ diff --git a/docs/template/api_wiki/public/fonts/Portmanteau Regular.ttf b/docs/template/api_wiki/public/fonts/Portmanteau Regular.ttf new file mode 100644 index 000000000..22a6c3831 Binary files /dev/null and b/docs/template/api_wiki/public/fonts/Portmanteau Regular.ttf differ diff --git a/docs/template/api_wiki/public/fonts/heavyweight.ttf b/docs/template/api_wiki/public/fonts/heavyweight.ttf new file mode 100644 index 000000000..fecf09bcc Binary files /dev/null and b/docs/template/api_wiki/public/fonts/heavyweight.ttf differ diff --git a/docs/template/api_wiki/public/fonts/mail ray stuff.ttf b/docs/template/api_wiki/public/fonts/mail ray stuff.ttf new file mode 100644 index 000000000..8837a2d95 Binary files /dev/null and b/docs/template/api_wiki/public/fonts/mail ray stuff.ttf differ diff --git a/docs/template/api_wiki/public/fonts/pony-island.ttf b/docs/template/api_wiki/public/fonts/pony-island.ttf new file mode 100644 index 000000000..ed06db9ba Binary files /dev/null and b/docs/template/api_wiki/public/fonts/pony-island.ttf differ diff --git a/docs/template/api_wiki/public/main.css b/docs/template/api_wiki/public/main.css index 023126588..8f537d36e 100644 --- a/docs/template/api_wiki/public/main.css +++ b/docs/template/api_wiki/public/main.css @@ -1,37 +1,155 @@ @font-face { - font-family: 'DPComic'; + font-family: DPComic; src: url('fonts/dpcomic.ttf') format('truetype'); font-weight: normal; font-style: normal; } -:root { - --page-gutter: clamp(1rem, 4vw, 5rem); +@font-face { + font-family: DPComic-Extended; + src: url('fonts/DPComic_Extended.otf') format('opentype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: '04b'; + src: url('fonts/04B_30__.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: Crumbled-Pixels; + src: url('fonts/Crumbled-Pixels.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: Daggersquare; + src: url('fonts/DAGGERSQUARE.otf') format('opentype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: Daggersquare-Oblique; + src: url('fonts/DAGGERSQUARE\ OBLIQUE.otf') format('opentype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: Garbageschrift; + src: url('fonts/GARBAGES.TTF') format('truetype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: Heavyweight; + src: url('fonts/heavyweight.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: Mail-Ray-Stuff; + src: url('fonts/mail\ ray\ stuff.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: Marksman; + src: url('fonts/Marksman.otf') format('opentype'); + font-weight: normal; + font-style: normal; +} - --document-font: 'DPComic', system-ui, sans-serif; - --code-font: 'DPComic', system-ui, sans-serif; +@font-face { + font-family: Pony-Island; + src: url('fonts/pony-island.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: Portmanteau; + src: url('fonts/Portmanteau\ Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +:root { + --page-gutter: clamp(1rem, 4vw, 5rem); + --document-font: 'DPComic', 'DPComic-Extended', system-ui, sans-serif; + --code-font: 'DPComic', 'DPComic-Extended', system-ui, sans-serif; --bs-font-sans-serif: var(--document-font); --bs-body-font-family: var(--document-font); --bs-font-monospace: var(--code-font); - --document-font-size: 20px; + --document-line-height: 1.2; + --document-letter-spacing: 1px; + --document-word-spacing: 0.9px; --code-font-size: 18px; - - --document-line-height: 1.5; - --code-line-height: 1.4; - + --code-line-height: 1.2; + --code-letter-spacing: 1px; + --code-word-spacing: 0.9px; --h1-font-size: 3.25em; --h2-font-size: 2.25em; --h3-font-size: 1.70em; --h4-font-size: 1.50em; --h5-font-size: 1.20em; --h6-font-size: 1.00em; - --heading-line-height: 1.2; + --heading-line-height: 1.0; + --heading-letter-spacing: 1px; + --heading-word-spacing: 0.9px; } html[data-document-font="dpcomic"] { - --document-font: 'DPComic', system-ui, sans-serif; + --document-font: 'DPComic', 'DPComic-Extended', system-ui, sans-serif; +} + +html[data-document-font="04b"] { + --document-font: '04b', sans-serif; +} + +html[data-document-font="crumbled-pixels"] { + --document-font: 'Crumbled-Pixels', sans-serif; +} + +html[data-document-font="daggersquare"] { + --document-font: 'Daggersquare', sans-serif; +} + +html[data-document-font="daggersquare-oblique"] { + --document-font: 'Daggersquare-Oblique', sans-serif; +} + +html[data-document-font="garbageschrift"] { + --document-font: 'Garbageschrift', sans-serif; +} + +html[data-document-font="heavyweight"] { + --document-font: 'Heavyweight', sans-serif; +} + +html[data-document-font="mail-ray-stuff"] { + --document-font: 'Mail-Ray-Stuff', sans-serif; +} + +html[data-document-font="marksman"] { + --document-font: 'Marksman', sans-serif; +} + +html[data-document-font="pony-island"] { + --document-font: 'Pony-Island', sans-serif; +} + +html[data-document-font="portmanteau"] { + --document-font: 'Portmanteau', sans-serif; } html[data-document-font="comic-sans"] { @@ -47,11 +165,52 @@ html[data-document-font="monospace"] { } html[data-document-font="system"] { - --document-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; + --document-font: system-ui, -apple-system, blinkmacsystemfont, "Segoe UI", sans-serif; } + html[data-code-font="dpcomic"] { - --code-font: 'DPComic', system-ui, sans-serif; + --code-font: 'DPComic', 'DPComic-Extended', system-ui, sans-serif; +} + +html[data-code-font="04b"] { + --code-font: '04b', sans-serif; +} + +html[data-code-font="crumbled-pixels"] { + --code-font: 'Crumbled-Pixels', sans-serif; +} + +html[data-code-font="daggersquare"] { + --code-font: 'Daggersquare', sans-serif; +} + +html[data-code-font="daggersquare-oblique"] { + --code-font: 'Daggersquare-Oblique', sans-serif; +} + +html[data-code-font="garbageschrift"] { + --code-font: 'Garbageschrift', sans-serif; +} + +html[data-code-font="heavyweight"] { + --code-font: 'Heavyweight', sans-serif; +} + +html[data-code-font="mail-ray-stuff"] { + --code-font: 'Mail-Ray-Stuff', sans-serif; +} + +html[data-code-font="marksman"] { + --code-font: 'Marksman', sans-serif; +} + +html[data-code-font="pony-island"] { + --code-font: 'Pony-Island', sans-serif; +} + +html[data-code-font="portmanteau"] { + --code-font: 'Portmanteau', sans-serif; } html[data-code-font="comic-sans"] { @@ -67,7 +226,7 @@ html[data-code-font="monospace"] { } html[data-code-font="system"] { - --code-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; + --code-font: system-ui, -apple-system, blinkmacsystemfont, "Segoe UI", sans-serif; } body { @@ -114,6 +273,7 @@ body { * { border-width: 4px !important; + border-radius: 4px !important; } b, strong { @@ -140,11 +300,11 @@ b, strong { } body > header, body[data-layout="landing"] > header { - min-height: 90px; + min-height: 120px; } body > footer, body[data-layout="landing"] > footer { - min-height: 90px; + min-height: 120px; display: flex; align-items: stretch; } @@ -194,7 +354,7 @@ body > footer, body[data-layout="landing"] > footer { overscroll-behavior: contain; } -@media (max-width: 767.98px) { +@media (width <= 767.98px) { #navpanel, #navbar { overflow: visible; @@ -252,6 +412,8 @@ body > footer, body[data-layout="landing"] > footer { .content, .facts { font-size: var(--document-font-size) !important; line-height: var(--document-line-height); + letter-spacing: var(--document-letter-spacing); + word-spacing: var(--document-word-spacing); } .content h1, @@ -297,22 +459,30 @@ body > footer, body[data-layout="landing"] > footer { .content h6, .content .h6 { line-height: var(--heading-line-height); + letter-spacing: var(--heading-letter-spacing); + word-spacing: var(--heading-word-spacing); } .toc ul { font-size: var(--document-font-size) !important; line-height: var(--document-line-height); + letter-spacing: var(--document-letter-spacing); + word-spacing: var(--document-word-spacing); } .affix { font-size: var(--document-font-size); line-height: var(--document-line-height); + letter-spacing: var(--document-letter-spacing); + word-spacing: var(--document-word-spacing); } code, kbd, samp, pre, .hljs, .facts code { font-family: var(--code-font); font-size: var(--code-font-size) !important; line-height: var(--code-line-height); + letter-spacing: var(--code-letter-spacing); + word-spacing: var(--code-word-spacing); } body[data-yaml-mime="ManagedReference"] article h2.section, @@ -329,7 +499,7 @@ body[data-yaml-mime="ApiPage"] article h2.section { } .inheritance-tree { - border-top: 1px solid currentColor; + border-top: 4px solid var(--bs-border-color, #444); padding-top: 0.35rem; } @@ -352,7 +522,7 @@ body[data-yaml-mime="ApiPage"] article h2.section { .api-parameters th, .api-returns th, .api-type-parameters th, .api-exceptions th, .api-fields th, .api-parameters td, .api-returns td, .api-type-parameters td, .api-exceptions td, .api-fields td { padding: 0.5rem 0.75rem; - border: 1px solid var(--bs-border-color, #444); + border: 4px solid var(--bs-border-color, #444); text-align: left; } @@ -362,17 +532,29 @@ html.community-documentation h1, html.community-documentation .h1, html.apispec-documentation h1, html.apispec-documentation .h1 { - border-bottom: 1px solid currentColor; + border-bottom: 4px solid var(--bs-border-color, #444); + padding-bottom: 0.35rem; +} + +html.api-documentation h1, +html.api-documentation .h1, +html.community-documentation h1, +html.community-documentation .h1, +html.apispec-documentation h1, +html.apispec-documentation .h1 { + border-bottom: 4px solid var(--bs-border-color, #444); padding-bottom: 0.35rem; } -html.api-documentation h3, -html.api-documentation .h3, -html.community-documentation h3, -html.community-documentation .h3, -html.apispec-documentation h3, -html.apispec-documentation .h3 { - border-bottom: 1px solid currentColor; +html.wiki-documentation h1, +html.wiki-documentation .h1 { + border-bottom: 4px solid var(--bs-border-color, #444); + padding-bottom: 0.35rem; +} + +html.wiki-documentation h2, +html.wiki-documentation .h2 { + border-bottom: 4px solid var(--bs-border-color, #444); padding-bottom: 0.35rem; } @@ -401,4 +583,153 @@ a.active { .typelist-content > div { padding: 0.2rem 0; +} + +blockquote { + border-left: 4px solid var(--bs-border-color, #444); + border-right-style: none; + border-top-style: none; + border-bottom-style: none; +} + +.toc li > a { + padding-left: 0.5rem; +} + +.nodeLabel, +.nodeLabel p { + font-family: var(--code-font); + font-size: var(--code-font-size) !important; + line-height: var(--code-line-height) !important; + box-sizing: border-box; + letter-spacing: var(--code-letter-spacing); + word-spacing: var(--code-word-spacing); +} + +.nodeLabel p { + color: var(--bs-code-color) !important; + padding: 0.15em 0.35em; + border-radius: 4px; + margin: 0; +} + +.edgeLabel, +.edgeLabel p { + font-family: var(--code-font); + font-size: var(--code-font-size) !important; + line-height: var(--code-line-height) !important; + box-sizing: border-box; + letter-spacing: var(--code-letter-spacing); + word-spacing: var(--code-word-spacing); +} + +.edgeLabel p { + background: var(--bs-tertiary-bg, #e9ecef) !important; + color: var(--bs-code-color) !important; + padding: 0.15em 0.35em; + border: 4px solid var(--bs-border-color, #444); + border-radius: 4px; + margin: 0; + box-sizing: border-box; +} + +div.mermaidTooltip { + font-family: var(--code-font); + font-size: var(--code-font-size) !important; + line-height: var(--code-line-height) !important; + background: var(--bs-tertiary-bg, #e9ecef) !important; + color: var(--bs-code-color) !important; + padding: 0.15em 0.35em; + border: 4px solid var(--bs-border-color, #444); + border-radius: 4px; + margin: 0; + box-sizing: border-box; + letter-spacing: var(--code-letter-spacing); + word-spacing: var(--code-word-spacing); +} + +.node rect, +.node circle, +.node ellipse, +.node polygon, +.node path { + rx: 4px; + ry: 4px; + stroke: var(--bs-border-color, #444) !important; + stroke-width: 4px !important; + fill: var(--bs-tertiary-bg, #e9ecef) !important; +} + +.labelBkg { + background: transparent !important; +} + +.mermaid { + width: 100%; + max-width: 100%; + display: block; + overflow-x: auto; +} + +.mermaid svg { + display: block; + max-width: 100% !important; +} + +.next-article:has(div) { + padding: 1rem; +} + +#nextArticle { + border: 4px solid var(--bs-border-color, #444); + background: var(--bs-tertiary-bg, #444); +} + +body:not([data-search])[data-layout=""] > main > .content > .contribution, body:not([data-search])[data-layout=""] > main > .content > .next-article, body:not([data-search])[data-layout="conceptual"] > main > .content > .contribution, body:not([data-search])[data-layout="conceptual"] > main > .content > .next-article { + display: flex; + justify-content: space-between; +} + +.prev { + border: 4px solid var(--bs-border-color, #444); + padding-left: 1.5rem; + border-radius: 4px; + background: var(--bs-tertiary-bg, #e9ecef); + color: var(--bs-code-color); + font-family: var(--code-font); + font-size: var(--code-font-size) !important; + line-height: var(--code-line-height) !important; + padding-right: 2.5rem; + letter-spacing: var(--code-letter-spacing); + word-spacing: var(--code-word-spacing); +} + +.next { + border: 4px solid var(--bs-border-color, #444); + padding-right: 1.5rem; + border-radius: 4px; + background: var(--bs-tertiary-bg, #e9ecef); + color: var(--bs-code-color); + font-family: var(--code-font); + font-size: var(--code-font-size) !important; + line-height: var(--code-line-height) !important; + padding-left: 2.5rem; + letter-spacing: var(--code-letter-spacing); + word-spacing: var(--code-word-spacing); +} + +.next-article > div { + flex: none; +} + +article { + margin-bottom: -3.5rem; +} + +article::after { + content: "Below are the Quick Guide Navigation Buttons:"; + display: block; + padding: 1rem; + border-top: 4px solid var(--bs-border-color, #444); + text-align: center; } \ No newline at end of file diff --git a/docs/template/api_wiki/public/main.js b/docs/template/api_wiki/public/main.js index 2561fe374..35a88e3dc 100644 --- a/docs/template/api_wiki/public/main.js +++ b/docs/template/api_wiki/public/main.js @@ -1,6 +1,186 @@ -export default { - defaultTheme: 'dark' -} +const getContentWidth = () => { + const article = document.querySelector('article'); + + if (!article) { + return 0; + } + + const style = getComputedStyle(article); + + return article.clientWidth + - parseFloat(style.paddingLeft || 0) + - parseFloat(style.paddingRight || 0); +}; + +const getNodeWidth = () => Math.max(180, Math.floor((getContentWidth() - 40) / 2)); + +const clamp = (value, min, max) => Math.min(max, Math.max(min, value)); + +const readCodeFontSize = () => { + const size = parseFloat( + getComputedStyle(document.documentElement).getPropertyValue('--code-font-size') + ); + + return Number.isFinite(size) && size > 0 ? clamp(size, 8, 40) : 18; +}; + +const LAYOUT_STYLE_VARS = ['--code-line-height', '--code-font-size', '--code-font', '--code-letter-spacing', '--code-word-spacing']; +const LAYOUT_ATTRS = ['data-code-font']; + +const readLayoutSignature = () => { + const root = document.documentElement; + const style = root.style; + + return [ + ...LAYOUT_STYLE_VARS.map(name => style.getPropertyValue(name)), + ...LAYOUT_ATTRS.map(name => root.getAttribute(name) || '') + ].join('|'); +}; + +const options = { + defaultTheme: 'dark', + + get mermaid() { + const width = getNodeWidth(); + const size = readCodeFontSize(); + const scale = clamp(size / 18, 0.5, 1.6); + + return { + themeVariables: { fontSize: `${size}px` }, + flowchart: { + useMaxWidth: false, + wrappingWidth: Math.max(90, Math.min(width, Math.round(width * scale))), + padding: Math.max(4, Math.round(15 * scale)), + nodeSpacing: Math.max(12, Math.round(50 * scale)), + rankSpacing: Math.max(12, Math.round(50 * scale)) + } + }; + }, + + start: () => { + const article = document.querySelector('article'); + + if (!article || !window.ResizeObserver) { + return; + } + + const MERMAID_FALLBACK = + 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs'; + + let mermaidPromise; + + const loadMermaid = () => { + mermaidPromise ??= (async () => { + const chunk = performance + .getEntriesByType('resource') + .map(entry => entry.name) + .find(url => /\/mermaid[.\-][\w\-]*\.min\.js$/.test(url)); + + return (await import(chunk || MERMAID_FALLBACK)).default; + })().catch(error => { + mermaidPromise = null; + throw error; + }); + + return mermaidPromise; + }; + + let lastWidth = article.clientWidth; + let lastSignature = readLayoutSignature(); + let timer = 0; + let pendingForce = false; + let running = false; + + const schedule = force => { + pendingForce ||= force; + clearTimeout(timer); + + timer = setTimeout(() => { + const forced = pendingForce; + pendingForce = false; + render(forced); + }, 150); + }; + + const render = async force => { + if (running) { + schedule(force); + return; + } + + const articleWidth = article.clientWidth; + + if (!force && articleWidth === lastWidth) { + return; + } + + lastWidth = articleWidth; + + if (article.querySelector('pre code.lang-mermaid')) { + schedule(force); + return; + } + + const nodes = []; + + article.querySelectorAll('pre.mermaid[data-mermaid]').forEach(diagram => { + if (!diagram.offsetParent) { + return; + } + + diagram.removeAttribute('data-processed'); + diagram.innerHTML = diagram.getAttribute('data-mermaid'); + + nodes.push(diagram); + }); + + if (nodes.length === 0) { + return; + } + + running = true; + + try { + const mermaid = await loadMermaid(); + const theme = document.documentElement.getAttribute('data-bs-theme') === 'dark' + ? 'dark' + : 'default'; + + mermaid.initialize({ + ...options.mermaid, + startOnLoad: false, + theme + }); + + await mermaid.run({ nodes }); + } catch (error) { + console.error(error); + } finally { + running = false; + } + }; + + new ResizeObserver(() => schedule(false)).observe(article); + + new MutationObserver(() => { + const signature = readLayoutSignature(); + + if (signature === lastSignature) { + return; + } + + lastSignature = signature; + schedule(true); + }).observe(document.documentElement, { + attributes: true, + attributeFilter: ['style', ...LAYOUT_ATTRS] + }); + + document.fonts?.ready.then(() => schedule(true)); + } +}; + +export default options; const docUrl = document.querySelector('meta[name="docfx:docurl"]')?.content || ''; diff --git a/docs/wiki/ability_management.md b/docs/wiki/ability_management.md index 76228cba5..beed4eb92 100644 --- a/docs/wiki/ability_management.md +++ b/docs/wiki/ability_management.md @@ -1,12 +1,14 @@ +# Abilities + ## Ability Management ---- + Abilities are unfortunately a little more difficult to manage than cards. -First of all, they have an attached 'AbilityBehaviour' type which you must implement. -Second, the texture for the ability is not actually stored on the AbilityInfo object itself; it is managed separately (bizarrely, the pixel ability icon *is* on the AbilityInfo object, but we won't get into all that). +First of all, they have an attached `AbilityBehaviour` type which you must implement. +Second, the texture for the ability is not actually stored on the `AbilityInfo` object itself; it is managed separately (bizarrely, the pixel ability icon *is* on the `AbilityInfo` object, but we won't get into all that). -Regardless, the API will help you manage all of this with the helpful AbilityManager class. Simply create an AbilityInfo object, and then call AbilityManager.Add with that info object, the texture for the icon, and the type that implements the ability. +Regardless, the API will help you manage all of this with the helpful `AbilityManager` class. Simply create an `AbilityInfo` object, and then call `AbilityManager.Add` with that info object, the texture for the icon, and the type that implements the ability. -Abilities inherit from DiskCardGame.AbilityBehaviour +Abilities inherit from `DiskCardGame.AbilityBehaviour` ```c# AbilityInfo myinfo = ...; @@ -14,7 +16,7 @@ Texture2D myTexture = ...; AbilityManager.Add(MyPlugin.guid, myInfo, typeof(MyAbilityType), myTexture); ``` -You can also use the AbilityManager.New method to simplify some of this process: +You can also use the `AbilityManager.New` method to simplify some of this process: ```c# AbilityInfo myInfo = AbilityManager.New(MyPlugin.guid, "Ability Name", "Ability Description", typeof(MyAbilityType), "/art/my_icon.png"); @@ -30,24 +32,24 @@ AbilityManager.New(MyPlugin.guid, "Ability Name", "Ability Description", typeof( ### Ability Extensions --- -- **SetCustomFlippedTexture:** Use this to give the ability a custom texture when it belongs to the opponent. -- **SetPixelIcon:** Use this to set the texture used when rendered as a GBC card. -- **AddMetaCategories:** Adds any number of metacategories to the ability. Will not duplicate. -- **SetDefaultPart1Ability:** Makes this appear in the part 1 rulebook and randomly appear on mid-tier trader cards and totems. -- **SetDefaultPart3Ability:** Makes this appear in the part 3 rulebook and be valid for create-a-card (make sure your power level is accurate here!) -- **SetActivated:** Sets whether or not the ability is an activated ability. Activated abilities can be clicked to trigger an effect. -- **SetPassive:** Sets whether or not the ability is a passive ability. Passive abilities don't do anything. -- **SetOpponentUsable:** Sets whether or not the ability can be used by the opponent (such as in a Totem battle). -- **SetConduit:** Sets whether or not the ability can be used to complete Circuits. -- **SetConduitCell:** Sets whether or not the ability is a conduit cell. Unsure of what this does. -- **SetCanStack:** Sets whether multiple copies of the ability will stack, activating once per copy. Optionally controls stack behaviour should a card with the ability evolve (see below). -- **SetTriggersOncePerStack:** Sets whether the ability (if it stacks) will only ever trigger once per stack. There's a...'feature' where stackable abilities will trigger twice per stack after a card evolves. +- **`SetCustomFlippedTexture`:** Use this to give the ability a custom texture when it belongs to the opponent. +- **`SetPixelIcon`:** Use this to set the texture used when rendered as a GBC card. +- **`AddMetaCategories`:** Adds any number of metacategories to the ability. Will not duplicate. +- **`SetDefaultPart1Ability`:** Makes this appear in the part 1 rulebook and randomly appear on mid-tier trader cards and totems. +- **`SetDefaultPart3Ability`:** Makes this appear in the part 3 rulebook and be valid for create-a-card (make sure your power level is accurate here!) +- **`SetActivated`:** Sets whether or not the ability is an activated ability. Activated abilities can be clicked to trigger an effect. +- **`SetPassive`:** Sets whether or not the ability is a passive ability. Passive abilities don't do anything. +- **`SetOpponentUsable`:** Sets whether or not the ability can be used by the opponent (such as in a Totem battle). +- **`SetConduit`:** Sets whether or not the ability can be used to complete Circuits. +- **`SetConduitCell`:** Sets whether or not the ability is a conduit cell. Unsure of what this does. +- **`SetCanStack`:** Sets whether multiple copies of the ability will stack, activating once per copy. Optionally controls stack behaviour should a card with the ability evolve (see below). +- **`SetTriggersOncePerStack`:** Sets whether the ability (if it stacks) will only ever trigger once per stack. There's a...'feature' where stackable abilities will trigger twice per stack after a card evolves. ## Programming Abilities ---- -Abilities require an instance of AbilityInfo that contains the information about the ability, but they also require you to write your own class that inherits from AbilityBehaviour and describes how the ability functions. -AbilityBehaviour contains a *lot* of virtual methods. For each event that can happen during a battle, there will be a 'RespondsToXXX' and an 'OnXXX' method that you need to override. The purpose of the 'RespondsToXXX' is to indicate if your ability cares about that event - you must return True in that method for the ability to fire. Then, to actually make the ability function, you need to implement your custom behavior in the 'OnXXX' method. +Abilities require an instance of `AbilityInfo` that contains the information about the ability, but they also require you to write your own class that inherits from `AbilityBehaviour` and describes how the ability functions. + +`AbilityBehaviour` contains a *lot* of virtual methods. For each event that can happen during a battle, there will be a `RespondsToXXX` and an `OnXXX` method that you need to override. The purpose of the `RespondsToXXX` is to indicate if your ability cares about that event - you must return True in that method for the ability to fire. Then, to actually make the ability function, you need to implement your custom behavior in the `OnXXX` method. See this example from the base game: @@ -70,12 +72,12 @@ public class Sharp : AbilityBehaviour } ``` -### Stat Icons +## Stat Icons Stat icons are unique abilities that apply specifically to a card's Health and/or Attack stats. -Stat icons require an instance of StatIconInfo that contains the information about the ability, but they also require you to write your own class that inherits from VariableStatBehaviour and describes how the ability functions. +Stat icons require an instance of `StatIconInfo` that contains the information about the ability, but they also require you to write your own class that inherits from `VariableStatBehaviour` and describes how the ability functions. -When you implement a variable stat behavior, you need to implement the abstract method GetStateValues. This method returns an array of integers: the value at index 0 is the variable attack power, and the value at index 1 is the variable health. +When you implement a variable stat behavior, you need to implement the abstract method `GetStateValues`. This method returns an array of integers: the value at index 0 is the variable attack power, and the value at index 1 is the variable health. Here is an example from the base game: @@ -94,22 +96,22 @@ public class BellProximity : VariableStatBehaviour } ``` -NOTE: you need to be very careful about how complicated the logic is in GetStatValues. This will be called *every frame!!* If you're not careful, you could bog the game down substantially. +NOTE: you need to be very careful about how complicated the logic is in `GetStatValues`. This will be called *every frame!!* If you're not careful, you could bog the game down substantially. -### Special Triggered Abilities +## Special Triggered Abilities Special triggered abilities are a lot like regular abilities; however, they are 'invisible' to the player (that is, they do not have icons or rulebook entries). As such, the API for these is very simple. You simply need to provide your plugin guid, the name of the ability, and the type implementing the ability, and you will be given back a wrapper containing the ID of your newly created special triggered ability. -Special triggered abilities inherit from DiskCardGame.SpecialCardBehaviour. +Special triggered abilities inherit from `DiskCardGame.SpecialCardBehaviour`. ```c# public readonly static SpecialTriggeredAbility MyAbilityID = SpecialTriggeredAbilityManager.Add(MyPlugin.guid, "Special Ability", typeof(MySpecialTriggeredAbility)).Id; ``` -And now MyAbilityID can be added to CardInfo objects. +And now `MyAbilityID` can be added to `CardInfo` objects. -Special abilities are programmed the same as regular abilities, except they do not have a metadata object associated with them (because they are not described or documented for the player) and they inherit from SpecialCardBehaviour instead of AbilityBehaviour. +Special abilities are programmed the same as regular abilities, except they do not have a metadata object associated with them (because they are not described or documented for the player) and they inherit from `SpecialCardBehaviour` instead of `AbilityBehaviour`. Here is an example from the base game: @@ -128,5 +130,5 @@ public class TrapSpawner : SpecialCardBehaviour } ``` -Note how the code uses 'base.PlayableCard' instead of 'base.Card'. +Note how the code uses `base.PlayableCard` instead of `base.Card`. Keep this in mind when making special abilities. \ No newline at end of file diff --git a/docs/wiki/activated_abilities.md b/docs/wiki/activated_abilities.md new file mode 100644 index 000000000..cd1a883f3 --- /dev/null +++ b/docs/wiki/activated_abilities.md @@ -0,0 +1,115 @@ +# Additional Functionality for Activated Abilities + +The API adds a new class `ExtendedActivatedAbilityBehaviour` that adds additional functionality for use when making activated abilities. + +This new class changes how activated abilities are made a bit. +As an example, if you were inheriting from the vanilla `ActivatedAbilityBehaviour`, you would override `BonesCost` to set the... Bones cost. +`ExtendedActivatedAbilityBehaviour` moves that functionality to the virtual int `StartingBonesCost`, and `BonesCost` is now used to keep track of the total cost, modifiders included. + +Put simply, to set the starting cost(s), you override `StartingBonesCost`, `StartingEnergyCost`, or `StartingHealthCost`. + +There is also a new override `IEnumerator` `PostActivate()` that triggers after the main body of code. + +## Blood Cost +This behaves exactly like the Blood cost for playing cards, where you have to sacrifice other cards on your side of the board in order to trigger an effect. + +The card info and card slot of sacrificed cards will be stored in the dictionary `currentSacrificedCardInfos`, with the `CardInfo` as the Key and the `CardSlot` as the Value. +Use this if you want to manipulate sacrificed cards once they're gone, but do note that the dictionary is cleared once the ability's effect has finished. + +```c# +public Dictionary currentSacrificedCardInfos = new(); + +public override IEnumerator Activate() +{ + // Create new copies of the sacrificed cards in their original board slots + foreach (KeyValuePair valuePair in currentSacrificedCardInfos) + { + yield return Singleton.Instance.CreateCardInSlot(valuePair.Value, valuePair.Key); + } +} +``` + +## Health Cost +This is easy enough to understand, it's a way of making an activated ability cost Health to use. +If the cost is equal to the card's current Health, then it will die. + +You can set this by overriding `StartingHealthCost`. + +## Dynamic Activation Costs +Using `ExtendedActivatedAbilityBehaviour`, you can change the cost of an activated ability during battle. + +By overriding `OnActivateBonesCostMod`, `OnActivateEnergyCostMod`, `OnActivateBloodCostMod`, or `OnActivateHealthCostMod`, you can make the ability's activation cost increase after it has been activated. +```c# +public class ActivateRepulsive : ExtendedActivatedAbilityBehaviour +{ + public static Ability abiliy; + public override Ability Ability => ability; + + public override int StartingBonesCost => 2; + public override int OnActivateBonesCostMod => 1; + + public override IEnumerator Activate() + { + yield return this.Effect(); + } +} +``` +You can keep changing these modifier fields as well, if you want the cost to increase exponentially. + +```c# +public override IEnumerator PostActivate(); +{ + OnActivateBonesCostMod += 1; +} +``` +You have basically no limits on how or when you can change the activation cost. + +```c# +public override IEnumerator OnUpkeep(bool playerUpkeep) +{ + bonesCostMod -= 1; +} +``` +This will reduce the Bones activation cost by 1 on upkeep. + +Note that `bonesCostMod` was used here instead of `OnActivateBonesCostMod`; The `OnActivate...` fields are used for changing the cost every activation, while the `...CostMod` fields are used for everything else. +Importantly, the `...CostMod` fields keep track of the current cost modifier. + +```c# +bonesCostMod = 0; +``` +This resets the current Bones cost modifier. + +An additional note to make is that you're not limited to only modifying a single cost; you can increase any cost you want, even those that aren't initially required for activation. + +## Keeping Track of It All +With the ability to modify a card's activation cost, the question of how to keep track of the new costs comes up. +While it's entirely possible you have an incredible memory and can just hoof it from there, the API provides a simpler way for you to keep track of it all by updating the Rulebook description of your ability. + +When right-clicking the ability icon of a card, the API will grab the current activation costs and display them. +This is unique to each card, so don't worry about keeping track of multiple activation costs. + +To tell the API what part of the Rulebook description should be modified, you must use `[sigilcost:X]` where X is the initial activation cost. +```c# +string rulebookDescription = "Pay [sigilcost:1 Bone, 1 Energy] to do a thing, then increase its activation cost by 1 Energy." + +AbilityManager.New(pluginGuid, rulebookName, rulebookDescription, typeof(T), "artpath.png"); +``` + +## Triggering `OnResolveOnBoard` +In Act 2, upon playing a card with an activated ability you will trigger a tutorial explaining how they work. +In order to ensure this code runs, you are prevented from overriding `OnResolveOnBoard`, both in the vanilla behaviour and in this extended version. + +Worry not however, for there is a workaround: the new virtual methods `RespondsToPostResolveOnBoard()` and `OnPostResolveOnBoard()` can be overridden instead to the same effect. + +```c# +public override IEnumerator RespondsToPostResolveOnBoard() +{ + return true; +} + +public override IEnumerator OnPostResolveOnBoard() +{ + // put your code here +} +``` \ No newline at end of file diff --git a/docs/wiki/ascension.md b/docs/wiki/ascension.md index 82909e52e..1e72e8d92 100644 --- a/docs/wiki/ascension.md +++ b/docs/wiki/ascension.md @@ -1,14 +1,16 @@ +# Ascension (Kaycee's Mod) + ## Adding New Challenges ---- -The API supports adding new Challenges as part of Kaycee's Mod using the ChallengeManager class. You can add a new Challenge using ChallengeManager.Add, either by passing in a new AscensionChallengeInfo object or by passing the individual properties of your challenge (which will construct the information object for you). This will make your challenge automatically appear in the challenge selection screen. -If you use the overload of Add that takes an AscensionChallengeInfo object, note that the "challengeType" field of type AscensionChallenge is completely irrelevant. This is an enumerated value, and it will be set for you by the ChallengeManager to ensure there is no collision with other challenges created by other mods. As such, you need to save the ID that is returned by the Add method of ChallengeManager so that you can reference it later. +The API supports adding new Challenges as part of Kaycee's Mod using the `ChallengeManager` class. You can add a new Challenge using `ChallengeManager.Add`, either by passing in a new `AscensionChallengeInfo` object or by passing the individual properties of your challenge (which will construct the information object for you). This will make your challenge automatically appear in the challenge selection screen. + +If you use the overload of Add that takes an `AscensionChallengeInfo` object, note that the `challengeType` field of type `AscensionChallenge` is completely irrelevant. This is an enumerated value, and it will be set for you by the `ChallengeManager` to ensure there is no collision with other challenges created by other mods. As such, you need to save the ID that is returned by the Add method of `ChallengeManager` so that you can reference it later. -If your challenge can stack, set the stackable flag to 'true' when adding your challenge. This will cause it to appear twice in the challenge selection screen. Yes, this means stackable challenges are currently limited to a max of two. +If your challenge can stack, set the stackable flag to `true` when adding your challenge. This will cause it to appear twice in the challenge selection screen. Yes, this means stackable challenges are currently limited to a max of two. You will be responsible to write all of the necessary patches for your challenge to function. When writing those patches, you *must* make sure that the challenge is active before you do anything. This is entirely up to you - there is nothing in the API that can detect this for you. -You should also make sure to alert the user whenever your challenge has triggered some change in the game. The ChallengeActivationUI class (from DiskCardGame) has a helper to alert the user. +You should also make sure to alert the user whenever your challenge has triggered some change in the game. The `ChallengeActivationUI` class (from `DiskCardGame`) has a helper to alert the user. ```c# private static AscensionChallenge ID = ChallengeManager.Add @@ -32,7 +34,7 @@ public static void DoSomething() ``` ## Adding New Starter Decks ---- + Starter decks are relatively simple. They simply need a title, an icon, and a set of three cards. You can also optionally add an "unlock level" which prevents your starter deck from being unlocked until the player reaches a certain challenge level. This defaults to 0, which means that the starter deck will always be unlocked. What if you want to make a starter deck with cards from another mod? What if you aren't 100% sure that those cards are loaded at the time that your starter deck is loaded? You can solve this manually by creating a dependency, which forces BepInEx to load the other mod first. However, if that mod uses JSON Loader, you need to create a dependency on JSON Loader instead, which could (in some very bizarre situations) create a situation where you both need to load before and after JSON Loader. Rather than sort out all of these possible scenarios one-by-one, you can instead create a starter deck with a set of three card names (strings) instead of three CardInfo objects. This will create a "delayed loading" scenario where the actual starter deck info won't be built until right before the Starter Deck screen loads. @@ -53,8 +55,8 @@ StarterDeckManager.New(MyPlugin.Guid, "Pelts", "art/pelts_deck_icon.png", new st ``` ## Adding Custom Screens to Kaycee's Mod ---- -This API supports adding new screens to Kaycee's Mod that execute before a run starts. New screens can use the AscensionScreenSort attribute to influence their sort order. Custom screens will execute in the following order: + +This API supports adding new screens to Kaycee's Mod that execute before a run starts. New screens can use the `AscensionScreenSort` attribute to influence their sort order. Custom screens will execute in the following order: 1. Starter Decks 2. Select Challenges @@ -66,17 +68,17 @@ This API supports adding new screens to Kaycee's Mod that execute before a run s 5. Requires End 4. Start Run -To create a custom screen, you need to write a special screen behavior class that inherits from AscensionRunSetupScreenBase (which in turn inherits from MonoBehavior). You will be required to override the following: +To create a custom screen, you need to write a special screen behavior class that inherits from `AscensionRunSetupScreenBase` (which in turn inherits from `MonoBehavior`). You will be required to override the following: -- headerText: The displayed title on the screen -- showCardDisplayer: Set this to return true if you want the panel on your screen that shows card information -- showCardPanel: Set this to return true if you want the scrollable panel on your screen that shows selectable cards +- `headerText`: The displayed title on the screen +- `showCardDisplayer`: Set this to return true if you want the panel on your screen that shows card information +- `showCardPanel`: Set this to return true if you want the scrollable panel on your screen that shows selectable cards -There is also a virtual method called InitializeScreen which you should use to build the content of your screen. +There is also a virtual method called `InitializeScreen` which you should use to build the content of your screen. In general, you are responsible for doing all the hard work of building your screen. However, all the boilerplate content is built for you. You will automatically be given the continue and back buttons, the header (which shows the current challenge level), the footer (which displays changes as the challenge level changes), and the title of your screen. You can also optionally be given a scrollable card selection panel and card information displayer panel if you need them (using the properties shown above). -Once you've written the custom screen class, you need to register it with AscensionScreenManager like so: +Once you've written the custom screen class, you need to register it with `AscensionScreenManager` like so: ```c# AscensionScreenManager.RegisterScreen(); diff --git a/docs/wiki/asset_bundle.md b/docs/wiki/asset_bundle.md index 891924999..773bc8db3 100644 --- a/docs/wiki/asset_bundle.md +++ b/docs/wiki/asset_bundle.md @@ -1,21 +1,21 @@ -## Asset Bundles ---- +# Asset Bundles + Asset bundles are how you can import your own models, textures, gameobjects and more into Inscryption. -Think of them as fancy .zip's that are supported by Unity. +Think of them as fancy `.zip`'s that are supported by Unity. -### Making Asset Bundles -1. Make a Unity project. Make sure you are using 2019.4.24f1 or your models will not show in-game. -2. Install the AssetBundleBrowser package. (Window->Package Manager) +## Making Asset Bundles +1. Make a Unity project. Make sure you are using `2019.4.24f1` or your models will not show in-game. +2. Install the `AssetBundleBrowser` package. (`Window` -> `Package Manager`) 3. Select the assets you want to be in the bundle (They need to be in the hierarchy, not in a scene!) -4. At the bottom of the Inspector window you'll see a section labedled "Asset Bundle" -5. Assign a new asset bundle name (example: testbundleexample) -6. Build Asset bundles Window->AssetBundle Browser +4. At the bottom of the Inspector window you'll see a section labeled "Asset Bundle" +5. Assign a new asset bundle name (example: `testbundleexample`) +6. Build Asset bundles `Window` -> `AssetBundle Browser` 7. Go to the output path using file explorer -8. There should be a file called 'testbundleexample' in that folder (It will not have an extension!) +8. There should be a file called `testbundleexample` in that folder (It will not have an extension!) 9. Copy this file into your mod folder -### Loading Asset Bundles +## Loading Asset Bundles ```csharp if (AssetBundleHelper.TryGet("pathToBundleFile", "nameOfPrefabInsideAssetBundle", out GameObject prefab)) @@ -33,4 +33,4 @@ Third parameter is the result of taking the object out of the asset bundle. **NOTE**: Getting a prefab from an asset bundle does not load it into the world. You need to clone it with Instantiate! -**NOTE 2**: If the GameObject is being created but the model isn't showing up in-game, make sure you are using Unity 2019.4.24f1 to build the asset bundle; the model will not show up otherwise! \ No newline at end of file +**NOTE 2**: If the `GameObject` is being created but the model isn't showing up in-game, make sure you are using Unity `2019.4.24f1` to build the asset bundle; the model will not show up otherwise! \ No newline at end of file diff --git a/docs/wiki/boss_masks.md b/docs/wiki/boss_masks.md new file mode 100644 index 000000000..88d774cbe --- /dev/null +++ b/docs/wiki/boss_masks.md @@ -0,0 +1,76 @@ +# Boss Masks + +When creating a custom boss opponent, you may feel the urge to change what mask Leshy adorns during the fight. +Fortunately, the API's got you covered. + +## Changing an Existing Mask +This allows you to change a mask already added to Inscyrption. Can be any Vanilla masks or one someone else has added. + +```csharp +MaskManager.Override("guid", "nameOfNewMask", LeshyAnimationController.Mask.Angler, "pathToTexture"); +``` +This example shows changing the mask the Angler uses to have a custom texture we are using. + +NOTE: This also changes the model so we can use a texture without the fuss of UV mapping the Anglers actual mask. +If you still want to use the Anglers model then use `.SetModelType(MaskManager.ModelType.Angler)` + +## Adding a Random Mask +If you want to add a new mask that will be randomly chosen when Leshy goes to put on a mask use this. +```csharp +MaskManager.AddRandom("guid", "nameOfNewMask", LeshyAnimationController.Mask.Prospector, "pathToTexture"); +``` +This example shows adding a new mask that when going to the Prospector boss fight, Leshy will choose between the default Prospector mask and this new one. + +You can add as many random masks as you want. There is no limit. + +## Adding a Custom Mask + +```csharp +MaskManager.Add("guid", "nameOfNewMask", "pathToTexture"); +``` + +## Adding a Custom Model + +```csharp +ResourceLookup resourceLookup = new ResourceLookup(); +resourceLookup.FromAssetBundle("pathToAssetBundle", "prefabNameInsideBundle"); +MaskManager.ModelType modelType = MaskManager.RegisterPrefab("guid", "nameOfModel", resourceLookup); + +var mask = MaskManager.Add("guid", "nameOfMask"); +mask.SetModelType(modelType); +``` + +## Putting on a Mask +This will tell Leshy to push a mask on his face. + +Useful for when you have your own boss sequence and you want to tell Leshy to put on your new mask! + +```csharp +LeshyAnimationController.Instance.PutOnMask(LeshyAnimationController.Mask.Woodcarver, false); +``` + +## Adding Custom Mask Behaviour + +```csharp +public class Plugin : BaseUnityPlugin +{ + private void Awake() + { + MyCustomMask.Setup(); + } +} +``` + +```csharp +public class MyCustomMask : MaskBehaviour +{ + public static LeshyAnimationController.Mask ID; + + public static void Setup() + { + var mask = MaskManager.Add("guid", "nameOfNewMask", "pathToTexture"); + mask.SetMaskBehaviour(typeof(MyCustomMask)); + ID = mask.ID; + } +} +``` \ No newline at end of file diff --git a/docs/wiki/card_management.md b/docs/wiki/card_management.md index 1fa87aeca..7d206980d 100644 --- a/docs/wiki/card_management.md +++ b/docs/wiki/card_management.md @@ -1,13 +1,15 @@ +# Cards + ## Card Management ---- -Card management is handled through InscryptionAPI.Card.CardManager. You can simply call CardManager.Add with a CardInfo object and that card will immediately be added to the card pool: + +Card management is handled through `InscryptionAPI.Card.CardManager`. You can simply call `CardManager.Add` with a `CardInfo` object and that card will immediately be added to the card pool: ```c# CardInfo myCard = ...; CardManager.Add(myCard); // Boom: done ``` -You can create CardInfo objects however you want. However, there are some helper methods available to simplify this process for you. -The most import of these is CardManager.New(name, displayName, attack, health, optional description) which creates a new card and adds it for you automatically: +You can create `CardInfo` objects however you want. However, there are some helper methods available to simplify this process for you. +The most import of these is `CardManager.New(name, displayName, attack, health, optional description)` which creates a new card and adds it for you automatically: ```c# CardInfo myCard = CardManager.New("example_card", "Sample Card", 2, 2, "This is just a sample card"); ``` @@ -30,39 +32,39 @@ CardInfo myCard = CardManager.New("example_card", "Sample Card", 2, 2, "This is ``` ### Card Extensions ---- + The following card extensions are available (may not be up-to-date): -- **SetPortrait:** Assigns the card's portrait art, and optionally its emissive portrait as well. You can supply Texture2D directly, or supply a path to the card's art. -- **SetEmissivePortrait:** If a card already has a portrait and you just want to modify its emissive portrait, you can use this. Note that this will throw an exception if the card does not have a portrait already. -- **SetAltPortrait:** Assigns the card's alternate portrait. -- **SetPixelPortrait:** Assigns the card's pixel portrait (for GBC mode). -- **SetCost:** Sets the cost for the card. There are also extensions for setting Blood, Bones, Energy, and Mox individually. -- **SetDefaultPart1Card:** Sets all of the metadata necessary to make this card playable in Part 1 (Leshy's cabin). -- **SetGBCPlayable:** Sets all of the metadata necessary to make this card playable in Part 2. -- **SetDefaultPart3Card:** Sets all of the metadata necessary to make this card playable in Part 3 (P03's cabin). -- **SetRare:** Sets all of the metadata ncessary to make this card look and play as Rare. -- **SetTerrain:** Sets all of the metadata necessary to make this card look and play as terrain. -- **SetPelt:** Sets all of the metadeta necessary to make this card look and play as a pelt card. Can optionally choose whether the card will trigger Pelt Lice's special ability. -- **SetTail:** Creates tail parameters. Note that you must also add the TailOnHit ability for this to do anything. -- **SetIceCube:** Creates ice cube parameters. Note that you must also add the IceCube ability for this to do anything. -- **SetEvolve:** Creates evolve parameters. Note that you must also add the Evolve ability for this to do anything. -- **SetOnePerDeck:** Sets whether or not the card is unique (only one copy in your deck per run). -- **SetHideAttackAndHealth:** Sets whether or not the card's Power and Health stats will be displayed or not. -- **SetGemify:** Sets whether or not the card should be Gemified by default. -- **SetAffectedByTidalLock:** Sets whether or not the card will be killed by the effect of the Tidal Lock sigil. -- **AddAbilities:** Add any number of abilities to the card. This will add duplicates. -- **AddAppearances:** Add any number of appearance behaviors to the card. No duplicates will be added. -- **AddMetaCategories:** Add any number of metacategories to the card. No duplicates will be added. -- **AddTraits:** Add any number of traits to the card. No duplicates will be added. -- **AddTribes:** Add any number of tribes to the card. No duplicates will be added. -- **AddSpecialAbilities:** Add any number of special abilities to the card. No duplicates will be added. +- **`SetPortrait`:** Assigns the card's portrait art, and optionally its emissive portrait as well. You can supply Texture2D directly, or supply a path to the card's art. +- **`SetEmissivePortrait`:** If a card already has a portrait and you just want to modify its emissive portrait, you can use this. Note that this will throw an exception if the card does not have a portrait already. +- **`SetAltPortrait`:** Assigns the card's alternate portrait. +- **`SetPixelPortrait`:** Assigns the card's pixel portrait (for GBC mode). +- **`SetCost`:** Sets the cost for the card. There are also extensions for setting Blood, Bones, Energy, and Mox individually. +- **`SetDefaultPart1Card`:** Sets all of the metadata necessary to make this card playable in Part 1 (Leshy's cabin). +- **`SetGBCPlayable`:** Sets all of the metadata necessary to make this card playable in Part 2. +- **`SetDefaultPart3Card`:** Sets all of the metadata necessary to make this card playable in Part 3 (P03's cabin). +- **`SetRare`:** Sets all of the metadata ncessary to make this card look and play as Rare. +- **`SetTerrain`:** Sets all of the metadata necessary to make this card look and play as terrain. +- **`SetPelt`:** Sets all of the metadeta necessary to make this card look and play as a pelt card. Can optionally choose whether the card will trigger Pelt Lice's special ability. +- **`SetTail`:** Creates tail parameters. Note that you must also add the TailOnHit ability for this to do anything. +- **`SetIceCube`:** Creates ice cube parameters. Note that you must also add the IceCube ability for this to do anything. +- **`SetEvolve`:** Creates evolve parameters. Note that you must also add the Evolve ability for this to do anything. +- **`SetOnePerDeck`:** Sets whether or not the card is unique (only one copy in your deck per run). +- **`SetHideAttackAndHealth`:** Sets whether or not the card's Power and Health stats will be displayed or not. +- **`SetGemify`:** Sets whether or not the card should be Gemified by default. +- **`SetAffectedByTidalLock`:** Sets whether or not the card will be killed by the effect of the Tidal Lock sigil. +- **`AddAbilities`:** Add any number of abilities to the card. This will add duplicates. +- **`AddAppearances`:** Add any number of appearance behaviors to the card. No duplicates will be added. +- **`AddMetaCategories`:** Add any number of metacategories to the card. No duplicates will be added. +- **`AddTraits`:** Add any number of traits to the card. No duplicates will be added. +- **`AddTribes`:** Add any number of tribes to the card. No duplicates will be added. +- **`AddSpecialAbilities`:** Add any number of special abilities to the card. No duplicates will be added. ## Evolve, Tail, Ice Cube, and Delayed Loading It's possible that at the time your card is built, the card that you want to evolve into has not been built yet. -You can use the event handler to delay building the evolve/icecube/tail parameters of your card, or you can use the extension methods above which will handle that for you. +You can use the event handler to delay building the `evolve`/`icecube`/`tail` parameters of your card, or you can use the extension methods above which will handle that for you. Note that if you use these extension methods to build these parameters, and the card does not exist yet, the parameters will come back null. -You will not see the evolve parameters until you add the evolution to the card list **and** you get a fresh copy of the card from CardLoader (as would happen in game). +You will not see the evolve parameters until you add the evolution to the card list **and** you get a fresh copy of the card from `CardLoader` (as would happen in game). ```c# CardManager.New("Example", "Base", "Base Card", 2, 2).SetEvolve("Evolve Card", 1); // "Evolve Card" hasn't been built yet @@ -74,7 +76,7 @@ Plugin.Log.LogInfo(CardLoader.GetCardByName("Example_Base").evolveParams == null ``` NOTE: for card blueprints (see [Encounters]()), Evolve, Tail, and Ice Cube will NOT work properly if you use delayed loading. -To solve this, simply create the evolution/tail/ice cube card before the base card like so: +To solve this, simply create the `evolution`/`tail`/`icecube` card before the base card like so: ```c# CardInfo myEvolveCard = CardManager.New("Example", "Evolve", "Evolve Card", 2, 5); // build "Evolve Card" first @@ -82,14 +84,14 @@ CardManager.New("Example", "Base", "Base Card", 2, 2).SetEvolve(myEvolveCard, 1) ``` ## Editing Existing Cards -If you want to edit a card that comes with the base game, you can simply find that card in the BaseGameCards list in CardManager, then edit it directly: +If you want to edit a card that comes with the base game, you can simply find that card in the `BaseGameCards` list in `CardManager`, then edit it directly: ```c# CardInfo card = CardManager.BaseGameCards.CardByName("Porcupine"); card.AddTraits(Trait.KillsSurvivors); ``` -There is also an advanced editing pattern that you can use to not only edit base game cards, but also potentially edit cards that might be added by other mods. To do this, you will add an event handler to the CardManager.ModifyCardList event. This handler must accept a list of CardInfo objects and return a list of CardInfo objects. In that handlers, look for the cards you want to modify and modify them there. +There is also an advanced editing pattern that you can use to not only edit base game cards, but also potentially edit cards that might be added by other mods. To do this, you will add an event handler to the `CardManager.ModifyCardList` event. This handler must accept a list of `CardInfo` objects and return a list of `CardInfo` objects. In that handlers, look for the cards you want to modify and modify them there. In this example, we want to make all cards that have either the Touch of Death or Sharp Quills ability to also gain the trait "Kills Survivors": @@ -107,7 +109,7 @@ By doing this, you can ensure that not on all of the base game cards get modifie ## Card Appearance Behaviours Card Appearance Behaviours are special classes that modify a card's appearance in-game. -They can be built into a CardInfo, or added to a card mid-game. +They can be built into a `CardInfo`, or added to a card mid-game. Appearance behaviours are implemented similarly to special abilities (for more information on those, see [here](ability_management.md#special-triggered-abilities)). @@ -115,9 +117,9 @@ Appearance behaviours are implemented similarly to special abilities (for more i public readonly static CardAppearanceBehaviour.Appearance MyAppearanceID = CardAppearanceBehaviourManager.Add(MyPlugin.guid, "Special Appearance", typeof(MyAppearanceBehaviour)).Id; ``` -Appearance behaviours implement the CardAppearanceBehaviour class. -There is an abstract method called ApplyAppearance that you must implement - this where you'll override the default appearance of the card. -There are also three other virtual methods: ResetAppearance, OnCardAddedToDeck, and OnPreRenderCard that give other hooks for changing the card's appearance. +Appearance behaviours implement the `CardAppearanceBehaviour` class. +There is an abstract method called `ApplyAppearance` that you must implement - this where you'll override the default appearance of the card. +There are also three other virtual methods: `ResetAppearance`, `OnCardAddedToDeck`, and `OnPreRenderCard` that give other hooks for changing the card's appearance. Here is an example from the base game: ```c# diff --git a/docs/wiki/custom_costs.md b/docs/wiki/custom_costs.md index f34ed3f5f..2a2fdc5a8 100644 --- a/docs/wiki/custom_costs.md +++ b/docs/wiki/custom_costs.md @@ -1,18 +1,18 @@ -## Custom Card Costs ---- -In Inscryption, the player will encounter four different resources as they play: Blood, Bones, Energy, and Mox/Gems. +# Custom Costs + +In Inscryption, the player will encounter four different resources as they play: `Blood`, `Bones`, `Energy`, and `Mox`/`Gems`. These resources are needed in order to play cards with the corresponding card cost, with most cards costing at least one of these four costs. With the API, it's possible to create cards that cost multiple types of resources, giving modders greater creativity when creating cards. There may come a time where the base costs don't meet your needs. Or maybe you just want to make a new cost. -Regardless of reason, the API provides a few ways of creating a basic card cost using the CardCostManager. +Regardless of reason, the API provides a few ways of creating a basic card cost using the `CardCostManager`. -The community patches contain a TestCost class that implements many of the features this page will cover. +The community patches contain a `TestCost` class that implements many of the features this page will cover. -### Creating a New Cost +## Creating a New Cost To create a new card cost, you need to create a new class that inherits from the API's [CustomCardCost](InscryptionAPI.CardCosts.CustomCardCost) class. -The CustomCardCost class provides you with the basic functionality to ensure your cost works. +The `CustomCardCost` class provides you with the basic functionality to ensure your cost works. Note that the API does not provide support for custom cost resources, so you will need to create the logic for it yourself through patching. Once you have created your cost's class, you need to register it with the API. @@ -54,10 +54,10 @@ public void AddCost() CardCostManager.Register("api", "TestCost", typeof(TestCost), TextureMethod, PixelTextureMethod); } ``` -When registering your cost, you can pass a static method for the Func's instead of creating a delegate. -These methods MUST have 3 parameters types: int, CardInfo, PlayableCard; and return a Texture2D. +When registering your cost, you can pass a static method for the `Func`'s instead of creating a delegate. +These methods MUST have 3 parameters types: int, `CardInfo`, `PlayableCard`; and return a `Texture2D`. -The int parameter represents the card's cost, and the CardInfo and PlayableCard parameters represent the current CardInfo and PlayableCard being checked. Note that the PlayableCard parameter can be null +The int parameter represents the card's cost, and the `CardInfo` and `PlayableCard` parameters represent the current `CardInfo` and `PlayableCard` being checked. Note that the `PlayableCard` parameter can be null ```c# public static Texture2D TextureMethod(int cardCost, CardInfo info, PlayableCard card) @@ -75,19 +75,19 @@ public static Texture2D PixelTextureMethod(int cardCost, CardInfo info, Playable ``` Card cost textures vary based on what part of the game the cost will be displayed in. -For Act 1, textures must be 64x28. In Act 2 they can be 30x8 at maximum or 7x8 (see above). Act 3 has no set size but they should be no larger than 300x78. +For Act 1, textures must be `64x28`. In Act 2 they can be `30x8` at maximum or `7x8` (see above). Act 3 has no set size but they should be no larger than `300x78`. -### Negative Costs, Cost Tier, and Turn 2 Play +## Negative Costs, Cost Tier, and Turn 2 Play The API allows you to define whether or not negative cost values should be considered in the game. This is false by default, meaning negative costs on cards will be read as 0 by the API (the actual assigned value is not changed). -You can use SetCanBeNegative to change this value, or directly modify the CanBeNegative field. +You can use `SetCanBeNegative` to change this value, or directly modify the `CanBeNegative` field. Cost tier is an integer denoting how expensive a card is, with each cost having its own formula that adds to the tier. For example, the formula for Bones' tier is (amount / 3), rounded down. By default, custom costs are not accounted for when determining a card's cost tier; -this can be fixed using SetCostTier to define the function to use. +this can be fixed using `SetCostTier` to define the function to use. ```c# public static void Init() @@ -108,7 +108,7 @@ when a battle starts, the game will give you at least one card that can be playe By default, when the game checks if a card with custom costs can be played by turn 2, it will return true - even if it can't be. -To fix this, you'll need to set your cost's CanBePlayedByTurn2WithHand function (long name, I know): +To fix this, you'll need to set your cost's `CanBePlayedByTurn2WithHand` function (long name, I know): ```c# public static void Init() { @@ -124,7 +124,7 @@ public static bool CanBePlayed(int amount, CardInfo card, List hand) } ``` -### Cost Choice Nodes +## Cost Choice Nodes If you want your cost to be chooseable in Act 1 at cost choice nodes, the API provides a method to do so: ```c# public static void Init() @@ -137,16 +137,16 @@ public static void Init() } ``` -Looking at the code above, you may be wondering what a ResourceType is. -To put it simply, the ResourceType is used by the game to determine what costs will be offered to the player, and then is used to determine what cards the player can receive. +Looking at the code above, you may be wondering what a `ResourceType` is. +To put it simply, the `ResourceType` is used by the game to determine what costs will be offered to the player, and then is used to determine what cards the player can receive. -#### Different Resource Amounts -Alongside a ResourceType, the game can further distinguish between different amounts of that resource when offering choices. +### Different Resource Amounts +Alongside a `ResourceType`, the game can further distinguish between different amounts of that resource when offering choices. By default, a custom cost at the choice node will give you any valid card with that cost, regardless of how many resources it needs. This is similar to how Bones and Energy are handled, but what if you want your cost to be handled like Blood? Being able to choose being a card that costs 1, 2, or 3 of your cost? -Well, all you need to do is use a variant of SetFoundAtChoiceNodes like so: +Well, all you need to do is use a variant of `SetFoundAtChoiceNodes` like so: ```c# public static void Init() @@ -161,9 +161,9 @@ public static void Init() } ``` -Alternatively, you can set the FullCardCost object's 'ChoiceAmounts' field to an integer array containing the amounts. +Alternatively, you can set the `FullCardCost` object's `ChoiceAmounts` field to an integer array containing the amounts. -#### Grouping Different Costs +### Grouping Different Costs In the event you're adding multiple custom costs to the game, you may want to group them all into a single choice. Maybe they're all related to each other, or you don't want to push out other choices at the node. Either way, the API offers this functionality. @@ -176,7 +176,7 @@ private void Example() } ``` -In order to group custom costs together, they must share the same ResourceType value. +In order to group custom costs together, they must share the same `ResourceType` value. ```c# public static void Init() { @@ -192,9 +192,9 @@ public static void Init() Note that grouped costs are incompatible with multiple-amount costs, meaning if one of the grouped costs has different possible choice amounts defined, they will be ignored. -### Adding Costs to Cards +## Adding Costs to Cards Custom costs are added to cards using the API's extended properties system and can be accessed the same way. -For clarity of purpose, the API provides some extension methods for setting a CardInfo's custom cost: +For clarity of purpose, the API provides some extension methods for setting a `CardInfo`'s custom cost: ```c# public void AddCard() { @@ -205,14 +205,14 @@ public void AddCard() } ``` -### Custom Costs for Death Cards +## Custom Costs for Death Cards Death cards aren't technically cards; they're card mods that are added to a template card. Because of this, simply adding an extended property to them won't work, since properties apply to ALL copies of the card. -If you want to create a death card that uses a custom play cost, you'll need to create a new card and then add properties to that new CardInfo. +If you want to create a death card that uses a custom play cost, you'll need to create a new card and then add properties to that new `CardInfo`. -Fortunately, the API's DeathCardManager is here to handle all this. -CreateCustomDeathCard() will return a new CardInfo that will represent your custom death card, using the data from the CardModificationInfo you give it to set the card's name, stats, etc.. +Fortunately, the API's `DeathCardManager` is here to handle all this. +`CreateCustomDeathCard()` will return a new `CardInfo` that will represent your custom death card, using the data from the `CardModificationInfo` you give it to set the card's name, stats, etc.. ```c# private void AddCustomDeathCard() { @@ -280,10 +280,10 @@ There are two custom cost events to hook into: `Part3CardCostRender.UpdateCardCostSimple` provides a quick way to provide/modify the cost textures that will be rendered on the card. `Part3CardCostRender.UpdateCardCostComplex` provides more advanced functionality, letting you modify a custom cost's `GameObject` directly, allowing you to attach any arbitrary amount of further objects/components as you wish. -#### Basic Card Cost -If you just want to display a basic card cost, all you need to do is prepare an icon that represents a single unit of your custom cost. For example, if you are building a custom cost for currency, you need an icon that represents spending one currency (for example, a `$` symbol). The width and height of the icon are up to you, but keep in mind that they will be placed onto a region that is 300x73 pixels, so the height should not exceed 73 pixels, and the wider the icon is, the fewer will fit on the space. +### Basic Card Cost +If you just want to display a basic card cost, all you need to do is prepare an icon that represents a single unit of your custom cost. For example, if you are building a custom cost for currency, you need an icon that represents spending one currency (for example, a `$` symbol). The width and height of the icon are up to you, but keep in mind that they will be placed onto a region that is `300x73` pixels, so the height should not exceed `73` pixels, and the wider the icon is, the fewer will fit on the space. -The `Part3CardCostRender.GetIconifiedCostTexture` helper method accepts one of these icons as well as a cost value and generates a pair of textures displaying that total cost. The first texture is the default texture (albedo) and the second is an emissive texture. If there is enough space in the 300x73 region to repeat the icon enough times to display the cost, it will do so. Otherwise, it will render a 7-segement display. +The `Part3CardCostRender.GetIconifiedCostTexture` helper method accepts one of these icons as well as a cost value and generates a pair of textures displaying that total cost. The first texture is the default texture (`albedo`) and the second is an `emissive` texture. If there is enough space in the `300x73` region to repeat the icon enough times to display the cost, it will do so. Otherwise, it will render a 7-segement display. In the "currency cost" example, where the icon is the `$` symbol: - A cost of 3 would be rendered as `$$$` diff --git a/docs/wiki/custom_properties.md b/docs/wiki/custom_properties.md index 0bffe54f8..ad43cddca 100644 --- a/docs/wiki/custom_properties.md +++ b/docs/wiki/custom_properties.md @@ -1,8 +1,8 @@ -## Custom/Extended Properties ---- -The API implements a system of custom properties that you can add to CardInfo's, AbilityInfo's, and CardModificationInfo's, and then retrieve them as needed. +# Extended Properties -In the same way that you can use Evolve parameters to make the evolve ability work, or the Ice Cube parameters to make the IceCube ability work, this can allow you to set custom parameters to make your custom abilities work. +The API implements a system of custom properties that you can add to `CardInfo`'s, `AbilityInfo`'s, and `CardModificationInfo`'s, and then retrieve them as needed. + +In the same way that you can use `Evolve` parameters to make the evolve ability work, or the Ice Cube parameters to make the `IceCube` ability work, this can allow you to set custom parameters to make your custom abilities work. ```c# // adding a custom property to a CardInfo @@ -12,23 +12,23 @@ sample.SetExtendedProperty("CustomPropertyName", "CustomPropertyValue"); string propValue = sample.GetExtendedProperty("CustomPropertyName"); ``` -### Reserved Properties +## Reserved Properties Some extended properties are reserved by the API for certain uses. The following are some extension properties you can use for your cards. -If you're using C# you can set these properties using their respective setter method, and can retrieve these properties with the appropritate getter method. -For JsonLoader users, these properties can be accessed using the same method as accessing any other extended property. +If you're using C# you can set these properties using their respective setter method, and can retrieve these properties with the appropriate getter method. +For JSONLoader users, these properties can be accessed using the same method as accessing any other extended property. **NOTE THAT THE NAMES ARE CASE-SENSITIVE.** |Property Name |Affected Type |Value Type |Description |Extension Method | |-----------------------|---------------|-----------|---------------------------------------------------------------------------------------|-----------------------| -|TriggersOncePerStack |AbilityInfo |Boolean |If the ability should trigger twice when the card evolves. |SetTriggersOncePerStack| -|HideSingleStacks |AbilityInfo |Boolean |If making an ability hidden should hide all of an ability's stacks or only one per. |SetHideSingleStacks | -|AffectedByTidalLock |CardInfo |Boolean |If the card should be killed by the effect of Tidal Lock. |SetAffectedByTidalLock | -|TransformerCardId |CardInfo |String |The name of the card this card will transform into when it has the Transformer sigil. |SetTransformerCardId | -|RemoveGreenGem |CardModificationInfo|Boolean |Removes the Green Mox from the card. |RemoveGreenGemCost* | -|RemoveOrangeGem |CardModificationInfo|Boolean |Removes the Green Mox from the card. |RemoveOrangeGemCost* | -|RemoveBlueGem |CardModificationInfo|Boolean |Removes the Green Mox from the card. |RemoveBlueGemCost* | - -* You can also use RemoveGemsCost to remove multiple gems at once \ No newline at end of file +|`TriggersOncePerStack` |`AbilityInfo` |`Boolean` |If the ability should trigger twice when the card evolves. |`SetTriggersOncePerStack`| +|`HideSingleStacks` |`AbilityInfo` |`Boolean` |If making an ability hidden should hide all of an ability's stacks or only one per. |`SetHideSingleStacks` | +|`AffectedByTidalLock` |`CardInfo` |`Boolean` |If the card should be killed by the effect of Tidal Lock. |`SetAffectedByTidalLock` | +|`TransformerCardId` |`CardInfo` |`String` |The name of the card this card will transform into when it has the Transformer sigil. |`SetTransformerCardId` | +|`RemoveGreenGem` |`CardModificationInfo`|`Boolean` |Removes the Green Mox from the card. |`RemoveGreenGemCost`* | +|`RemoveOrangeGem` |`CardModificationInfo`|`Boolean` |Removes the Green Mox from the card. |`RemoveOrangeGemCost`* | +|`RemoveBlueGem` |`CardModificationInfo`|`Boolean` |Removes the Green Mox from the card. |`RemoveBlueGemCost`* | + +* You can also use `RemoveGemsCost` to remove multiple gems at once \ No newline at end of file diff --git a/docs/wiki/dialouge_events.md b/docs/wiki/dialouge_events.md new file mode 100644 index 000000000..78950e22d --- /dev/null +++ b/docs/wiki/dialouge_events.md @@ -0,0 +1,156 @@ +# Dialogue Events + +After looking at the example above, you might be wondering *"What's all of that `DialogueId` stuff about? How do I make my own dialogue events?"*. + +I'm gonna explain everything to you in detail now! + +## Dialogue Triggers +Talking cards can respond to a variety of game events. If you want your card to respond to a given event, you can override that property and return the ID of your new dialogue event. + +Some properties are abstract and *must* be implemented: namely, `OnDrawnDialogueId`, `OnPlayFromHandDialogueId`, `OnAttackedDialogueId`, `OnBecomeSelectablePositiveDialogueId` and `OnBecomeSelectableNegativeDialogueId`. + +And here's a full list of triggers you can override, and a small explanation of each. + +**Note**: All of these names end in `DialogueId`, so I've omitted that last part of the name to be concise. + +| Trigger | Description | +|----------------------------|----------------------------------------------------------------| +| `OnDrawn` | Plays when your card is drawn. | +| `OnPlayFromHand` | Plays when your card is played. | +| `OnAttacked` | Plays when your card is attacked. | +| `OnBecomeSelectablePositive` | Plays when your card becomes selectable for a positive effect. | +| `OnBecomeSelectableNegative` | Plays when your card becomes selectable for a negative effect. | +| `OnSacrificed` | Plays when your card is sacrificed. | +| `OnSelectedForDeckTrial` | Plays when your card is selected in the deck trial node. | +| `OnSelectedForCardMerge` | Plays before your card receives the sigil in the sigil node. | +| `OnSelectedForCardRemove` | Plays when your card is selected for removal. | + +Additionally, the `OnDrawnSpecialOpponentDialogueIds` dictionary lets you add special dialogue when your card is drawn in a specific boss battle, like this: + +```csharp +public override Dictionary OnDrawnSpecialOpponentDialogueIds => new Dictionary() +{ + { Opponent.Type.ProspectorBoss, "Example_TalkAboutProspector" } +}; +``` + +## Creating a Dialogue Event +You can create your own dialogue events with this API's `DialogueManager.GenerateEvent()` method, like this: + +```csharp +DialogueManager.GenerateEvent( + pluginGUID: Plugin.PluginGuid, + name: "Example_OnPlayFromHand", + mainLines: new List() { "This is a main line." }, + repeatLines: new List>() + { + new List() { "This is a repeat line!" }, + new List() { "This is another repeat line!" } + } +); +``` + +A brief explanation of each parameter: + +| Field | Description | +|-------------|---------------------------------------------------------------------------------| +| `pluginGUID` | Your mod's GUID. | +| `name` | The name for your dialogue event; this is what you'll use to refer to it! | +| `mainLines` | A set of lines that plays in the very first time this event runs. | +| `repeatLines` | Multiple sets of lines that are played after the first time this event has run. | + +## Dialogue Codes +A really neat feature of Inscryption's dialogue events are dialogue codes. They add a lot of life to dialogue! + +The dialogue codes most relevant to talking cards will be explained below. All of these work with talking cards. + +## Wait (`[w:]`) +This is by far the dialogue code you'll wanna use the most. It's also the one the game itself uses the most in all of its dialogue. + +The `[w:x]` dialogue code adds a pause of x seconds before the rest of a sentence plays. + +You can use it like this: +``` +"Hello.[w:1] How are you?" +``` +In this example, after saying "Hello.", the character waits 1 second before saying "How are you?". + +The number of seconds does not have to be an integer. Using `[w:0.2]` to wait only 0.2 seconds is valid, for example, and used often throughout the base game's dialogue. + +This being said, I'd advise you not to go below `[w:0.1]`, as I don't know how small the number can go before issues arise. (And there's no point in going below that, anyhow.) + +## Color (`[c:]`) +The `[c:]` dialogue code changes the color of a portion of your text. + +You can use it like this: +``` +"[c:R]This text is red.[c:] This text is not." +``` +In this example, the part after `[c:R]` is colored in the color that matches the code `R`, which is the color red, and the part after `[c:]` has the default text color. You can think of this as "switching on" the colorful text mode and then switching it off. + +*"But how do I know the codes for each color?"* +Fear not! Here's a comprehensive table of all available colors and their respective codes: + +| Code | Color | +|--------|-------------------| +| `B` | Blue | +| `bB` | Bright Blue | +| `bG` | Bright Gold | +| `blGr` | Bright Lime Green | +| `bR` | Bright Red | +| `brnO` | Brown Orange | +| `dB` | Dark Blue | +| `dlGr` | Dark Lime Green | +| `dSG` | Dark Seafoam | +| `bSG` | Glow Seafoam | +| `G` | Gold | +| `gray` | Gray | +| `lGr` | Lime Green | +| `O` | Orange | +| `R` | Red | + +(For the record: These are the colors the game has available, built-in. I did not choose them. Yes, it's a very odd selection of colors.) + +### Custom Colors +I have added a way to use custom colors with dialogue codes. In place of one of the color codes in the table above, you can instead use a [hex color code](https://htmlcolorcodes.com/color-picker/), and this mod will parse the code into an usable Color for the text. + +Here's an example: +``` +"You must be... [w:0.4][c:#7f35e6]confused[c:][w:1].", +``` +In this example, the word "confused" is colored in the color #7f35e6. Which, if you don't wanna look it up, it's [this color!](https://g.co/kgs/JPHV5v) + +Please note that for compatibility reasons, your hex color code **should include the '#'**. + +## Making Leshy Talk +The `[leshy:x]` dialogue code makes Leshy say `x`. This color code is very useful for making Leshy and your card talk a bit between each other! + +You can use it like this: + +``` +"We're all doomed.[leshy:Quiet now.][w:2]", +``` + +In this example, the character says "We're all doomed." and then Leshy says "Quiet now." right after. The text remains on the screen for 2 seconds. + +There are a few things to note from that example: + +1. You don't need to put quotation marks around the line Leshy is going to say. +2. The "Wait" dialogue code is still usable with Leshy's lines. + +## Using Emotions in Dialogue +You can change your character's emotion in their dialogue lines with the dialogue code `[e:x]`, where `x` is the name of an emotion. You can look at the table above for the names of all the available emotions. + +This mod adds patches to make the emotion names not case-sensitive, which means the following lines are all equally valid: + +``` +"[e:Anger]I'm angry." +"[e:anger]I'm angry." +"[e:AnGeR]I'm angry and my keyboard is acting up." +``` + +If you prefer, you can use the numeric value associated with an emotion instead of its name! This is perfectly valid, for example: + +``` +"[e:2]I'm angry." +``` diff --git a/docs/wiki/getting_started.md b/docs/wiki/getting_started.md index b6a020885..141f7763c 100644 --- a/docs/wiki/getting_started.md +++ b/docs/wiki/getting_started.md @@ -1,153 +1,139 @@ -## Getting Started: Installation ---- -To begin, we'll go over how to install BepInEx, the framework all Inscryption mods use. This is a necessary step to playing modded Inscryption, so be sure to follow this carefully. - -**FOR LINUX AND STEAMDECK:** Ensure that the game is set to run using `Proton` in he game settings on steam. Should be a setting like this: `Change launch behaviour` -> `Proton`. - -### Installing with a Mod Manager -1. Download and install [Thunderstore Mod Manager](https://www.overwolf.com/app/Thunderstore-Thunderstore_Mod_Manager), [Gale](https://thunderstore.io/c/inscryption/p/Kesomannen/GaleModManager/), [Pulsar](https://pulsarmods.com/) or [r2modman](https://thunderstore.io/c/inscryption/p/ebkr/r2modman/). -2. Click the **Install with Mod Manager** button on the top of [BepInEx's](https://thunderstore.io/c/inscryption/p/BepInEx/BepInExPack_Inscryption/) page. -3. Run the game via the mod manager. - -If you have issues with Mod Managers head to one of these discords; - -* **Thunderstore Support Discord:** [Here](https://discord.gg/Fbz54kQAxg) -* **R2ModMan Support Discord:** [Here](https://discord.gg/R85wjqa4WN) -* **Gale Mod Manager Support Discord:** [Here](https://discord.gg/sfuWXRfeTt) - -### Installing Manually -1. Install [BepInEx](https://thunderstore.io/package/download/BepInEx/BepInExPack_Inscryption/5.4.2305/) by pressing `Manual Download` and extract the contents into a folder. **Do not extract into the game folder!** -2. Move the contents of the `BepInExPack_Inscryption` folder into the game folder (where the game executable is; usually found here: `C:\Program Files (x86)\Steam\steamapps\common\Inscryption`). -3. Run the game. If everything was done correctly, you will see the BepInEx console appear on your desktop. Close the game after it finishes loading. -4. Install [MonoModLoader](https://inscryption.thunderstore.io/package/BepInEx/MonoMod_Loader_Inscryption/) and extract the contents into a folder. -5. Move the contents of the `patchers` folder into `BepInEx/patchers` (If any of the mentioned BepInEx folders don't exist, just create them). -6. Install [Inscryption API](https://inscryption.thunderstore.io/package/API_dev/API/) and extract the contents into a folder. -7. Move the contents of the `plugins` folder into `BepInEx/plugins` and the contents of the `monomod` folder into the `BepInEx/monomod` folder. -8. Run the game again. If everything runs correctly, a message will appear in the console telling you that the API was loaded. -9. For any additional mods create a new subfolder, it can be called anything and extract the zips archive into it and if there is a `BepInEx` folder within the zip instead drop the contents of that folder into the `BepInEx` root for the modding instance. EX; - ``` - BepInEx // These go within the BepInEx root folder - |-- config - |-- patchers - |-- plugins - |-- monomod - |-- core - plugins // Files within go into the created plugin subfolder that was created for the mod - |-- Art - |-- Scripts - |-- MyMod.dll - manifest.json // Ignorable, but if kept, goes in plugin subfolder - README.md // Ignorable, but if kept, goes in plugin subfolder - CHANGELOG.md // Ignorable, but if kept, goes in plugin subfolder - icon.png // Ignorable, but if kept, goes in plugin subfolder - ``` -10. Run the game once more and everything should be correct and working. - -### Installing Manually (XBOX Game-Pass) -1. Install [BepInEx](https://thunderstore.io/package/download/BepInEx/BepInExPack_Inscryption/5.4.2305/) by pressing `Manual Download` and extract the contents into a folder. **Do not extract into the game folder!** -2. Move the contents of the `BepInExPack_Inscryption` folder into the game folder (where the game executable is; usually found here: `C:\XboxGames\Inscryption\Content`). -3. Install the following package: [XboxSilencio](https://thunderstore.io/c/inscryption/p/CORE_API_TEAM/GamepassSilencio/), this is a package which aims to solve frictions with XBOX Gamepass specific installations, such as HueyFS related errors. -4. Run the game. If everything was done correctly, you will see the BepInEx console appear on your desktop. Close the game after it finishes loading. -5. Install [MonoModLoader](https://inscryption.thunderstore.io/package/BepInEx/MonoMod_Loader_Inscryption/) and extract the contents into a folder. -6. Move the contents of the `patchers` folder into `BepInEx/patchers` (If any of the mentioned BepInEx folders don't exist, just create them). -7. Install [Inscryption API](https://inscryption.thunderstore.io/package/API_dev/API/) and extract the contents into a folder. -8. Move the contents of the `plugins` folder into `BepInEx/plugins` and the contents of the `monomod` folder into the `BepInEx/monomod` folder. -9. Run the game again. If everything runs correctly, a message will appear in the console telling you that the API was loaded. -10. For any additional mods create a new subfolder, it can be called anything and extract the zips archive into it and if there is a `BepInEx` folder within the zip instead drop the contents of that folder into the `BepInEx` root for the modding instance. EX; - ``` - BepInEx // These go within the BepInEx root folder - |-- config - |-- patchers - |-- plugins - |-- monomod - |-- core - plugins // Files within go into the created plugin subfolder that was created for the mod - |-- Art - |-- Scripts - |-- MyMod.dll - manifest.json // Ignorable, but if kept, goes in plugin subfolder - README.md // Ignorable, but if kept, goes in plugin subfolder - CHANGELOG.md // Ignorable, but if kept, goes in plugin subfolder - icon.png // Ignorable, but if kept, goes in plugin subfolder - ``` -11. Run the game once more and everything should be correct and working. - -### Installing on the Steam Deck -1. Download [r2modman](https://thunderstore.io/c/inscryption/p/ebkr/r2modman/) on the Steam Deck's Desktop Mode and open it from its download using its `AppImage` file. -2. Download the mods you plan on using and their dependencies. -3. Go to the setting of the profile you are using for the mods and click `Browse Profile Folder`. -4. Copy the BepInEx folder, then go to Steam and open Inscryption's Properties menu -5. Go to `Installed Files` click `Browse` to open the folder containing Inscryption's local files; paste the BepInEx folder there. -6. Enter Gaming Mode and check 'Force the use of a specific Steam Play compatibility tool' in the Properties menu under `Compatibility`. -7. Go to the launch parameters and enter `WINEDLLOVERRIDES="winhttp.dll=n,b" %command%`. -8. Open Inscryption. If everything was done correctly, you should see a console appear on your screen. - -### Mac & Linux -1. Follow the steps here first: -2. Next do steps 4-10 of the Manual Installation -3. Your game should be setup for inscryption modding now - -If you have any issues with Mac/Linux, Steam Deck, or Manual head over to the discord for this game: - -* **Inscryption Modding Discord:** [Here](https://discord.gg/ZQPvfKEpwM) - ## Getting Started: Modding --- -Modding Inscryption requires a knowledge of coding in C#, and in many cases an understanding of how to patch the game using HarmonyPatch. +Modding Inscryption requires a knowledge of coding in C# or a similar programming language such as Java, and in many cases an understanding of how to patch the game using HarmonyPatch, which you can find the docs for [here](https://github.com/BepInEx/HarmonyX/wiki) for HarmonyX, and [here](https://harmony.pardeike.net/v2/articles/intro.html) for the underlying basic Harmony. -If you're unfamiliar with any of this, or just want to create cards and sigils, you can use [JSONLoader](https://inscryption.thunderstore.io/package/MADH95Mods/JSONCardLoader/). +If you're unfamiliar with any of this, or just want to create cards and sigils, you can use [JSONLoader](https://inscryption.thunderstore.io/package/MADH95Mods/JSONCardLoader/), if you wish to avoid learning C#. -### Modding with JSONLoader - JSONLoader is a versatile mode that provides a more beginner-friendly way of creating new cards and abilities for Inscryption using JSON syntax, which is much simpler than C#. +If your up for the task, a good entry point to learning C# is [this tutorial by freeCodeCamp.org](https://www.youtube.com/watch?v=GhQdlIFylQ8). It's around a 4 hour video, we'd advise you to tackle it in portions. One deviation from the video however, we are going to advise you to grab a thing called [JetBrains Rider](https://www.jetbrains.com/rider/), you'll specifically want the `Free for non-commerical use` version. If your familiar with the UX of [IntelliJ Idea](https://www.jetbrains.com/idea/) for Java based modding, than it should feel familiar to you. -JSONLoader's documentation can be found [here](https://github.com/MADH95/JSONLoader). - -A video tutorial covering how to use JSONLoader in a basic form can be found [here](https://www.youtube.com/watch?v=grTSkpI4U7g). +If at any point your confused while doing the tutorial, feel free to ask for help in [the discord](https://discord.gg/qEqtF29ZEt) specifically, the channel entitled `programming-help` will be your friend. Mind you help will not be immediate, but we will try and get help to you as soon as we are able. ### Modding with C# -To begin modding with C#, you will need to create a new C# project using a code editor. -We recommend and assume you're using Microsoft's Visual Studio. - -Your project's target framework needs to be `netstandard2.0`. - -Once your project's created, go to `Project > Manage NuGet Packages`. -Click the dropdown menu for 'Package source' and check that 'BepInEx' and 'nuget' is there. - -If BepInEx or nuget aren't an available source, we need to add them. -To add a new package source, click on the gear icon next to the package source selector, then click the large green plus-sign. - -To add BepInEx, change the name to 'BepInEx' and the source link to 'https://nuget.bepinex.dev/v3/index.json'. -To add nuget, change the name to 'nuget' and the source link to 'https://nuget.windows10ce.com/nuget/v3/index.json'. -Change the package source to 'All' then click 'Browse'. -We want to install the following packages (**Make sure the version numbers match!**): -- BepInEx.Analyzers v1.0.8 -- BepInEx.Core v5.4.19 -- HarmonyX v2.9.0 -- Inscryption.GameLibs v1.9.0-r.0 -- UnityEngine.Modules v2019.4.24 - -You will also need to add the API as a reference. -There are a couple ways to do this, detailed below; whichever way you choose to do this, you'll also need to need to reference `InscryptionAPI.dll`, which should be in your BepInEx plugins folder; copy this path for future use. - -To do so, go to your 'BepInEx/plugins' folder and copy the folder path. -Then, navigate to `Project > Add Project Reference` and click 'Browse'. -Copy the folder path and add 'InscryptionAPI.dll' as a reference. -You can do this for other mods' .dll files if you want to reference them as a mod dependency (a separate mod that your mod relies on to work). +First things first, in order to even make a mod for the game you will need a few things setup. First off if you haven't installed it yet, we reccomend getting a tool called [JetBrains Rider](https://www.jetbrains.com/rider/). This guide will follow the layout of this IDE. If you still want to use [Visual Studio](https://visualstudio.microsoft.com/) instead, no one is going to stop you, there will be a foldout below this guide with the setup for that IDE, note its a little outdated. + +#### JetBrains Rider Based Project Setups + +
+ +Click me to close + + +Now that you have your IDE, we'll start by making our Project. + +1. Open up the IDE, than click on `New`, followed by `New Solution`. +2. One the menu pops up select `Class Library` from the Left-Side panel. +3. Next we want to fill in some fields + 1. Where it says `Solution Name`, update the associated field to the name of your mod. + 2. Next to that field theres a little thing that says `format`, click the drop down and change it to `sln`. + 3. Where it says `Target Framework`, select the dropdown and change it to `v4.7.2`. If it is not present, that means you don't have the SDK or Framework installed. + 1. First ensure the [Net10 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/10.0) is installed, you'll want the `SDK` associated with your OS and Architecture. Note you will want to download an `Installer` not a `Binary`. + 2. Now ensure the [Netframework 4.7.2](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net472) is installed, you'll want the `Offline Installer` under `Build Apps` called the `Developer Pack`. + 4. Ensure the `Language` is set to `C#`, and the Type is set to `Class Library`. +4. Now press `Create`. + +Now we have your basic project setup, if you see a pop up about Microsoft Defender affecting the IDE click `Exclude folders`, this will allow the IDE to do its job much quicker than it would be able to otherwise. + +Alright now we'll need to make sure you have the NuGet Package sources you'll need for success. The following steps will guide you through the process. + +1. Right-Click on the `Solution`, hover over `Open In`, than select `Explorer`. +2. Once open you should see the File Explorer opened to a folder containing an `sln` file with a name matching your Project's. +3. In this folder create a new text file, than open it in a text editor. Now enter the following into the text file: + ```xml + + + + + + + + + ``` +4. Save the file, and rename it to `NuGet.Config`. +5. If you don't see the sources in your IDE, try following this short guide and try again: [File Explorer (Windows); JSONLoader Wiki](https://github.com/Chaosyr/JSONCardLoaderWiki/wiki/JSON-and-CSV-Loader-API-Documentation-%E2%80%90-JSON-Inscrybing#file-explorer-windows). Simply put, your windows might not of overwrote the file extension because your extensions are hidden by default. + +Now that we have this setup when you hit `All enabled feeds` under the `NuGet` menu found in the bottom of the left-hand toolbar, you should see 3 feeds, labeled `BepInEx`, `nuget.org`, and `ts-nuget`. Also ensure `Prerelease` is ticked on. + +Next up, press `Discover` under the `Packages` tab of the `NuGet` menu. Search up the following packages in the table below, than install the version specified to the solution, also ensure the source matches. + +| Package Name | Version | Source | +| :--------------------- | :--------: | ----------: | +| `BepInEx.Analyzers` | 1.0.8 | `BepInEx` | +| `BepInEx.Core` | 5.4.21 | `BepInEx` | +| `HarmonyX` | 2.10.2 | `nuget.org` | +| `Inscryption.GameLibs` | v1.9.0-r.0 | `BepInEx` | +| `UnityEngine.Modules` | v2019.4.24 | `BepInEx` | +| `API_dev-API` | 2.24.1 | `ts-nuget` | + +If you need any other dependencies that are mods on Thunderstore, search up its package identifier in the NuGet Search, for example `Nevernamed-Nevernameds_Sigilarium`. You can get the package identifier by going to the mods page on the Thunderstore Website, such as: [Nevernameds Sigilarium](https://thunderstore.io/c/inscryption/p/Nevernamed/Nevernameds_Sigilarium/). Beneath the Download, Like and Report Buttons, there will be a string of text resembling `Team-Name-Version`. You'll want to copy that string and remove the version part of it, that is what you will put in the NuGet Search. + +
+ +#### Visual Studio Based Project Setups + +
+ +Click me to expand + + +Now that you have your IDE, do the following to begin with. Your project's target framework needs to be `netstandard4.7.2`. Once your project's created, go to `Project > Manage NuGet Packages`. Click the dropdown menu for `Package source` and check that `BepInEx`, `nuget.org` and `ts-nuget` are there. + +If `BepInEx`, `nuget.org` or `ts-nuget` aren't an available source, we need to add them. There are two methods you can use to address this, the first of which is entirely within Visual Studio, the second of which is through file, which may be less complicated. + +
+ +Via Package Source Configuration + +For each missing source you will want to do the following: + +1. Click on the `Gear` icon next to the package source selector. +2. Click the large green `Plus`. +3. Set the fields to match what is shown in the below list: + - To add `BepInEx`, change the name to `BepInEx` and the source link to `https://nuget.bepinex.dev/v3/index.json`. + - To add `nuget.org`, change the name to `nuget.org` and the source link to `https://api.nuget.org/v3/index.json`. + - To add `ts-nuget`, change the name to `ts-nuget` and the source link to `https://nuget.windows10ce.com/nuget/v3/index.json`. + +
+ +
+ +Via File + + +1. Right-Click the `Solution` found at the top of the `Solution Explorer`. +2. Click `Open Folder in File Explorer`. +3. Once open you should see the File Explorer opened to a folder containing an `sln` file with a name matching your Project's. +4. In this folder create a new text file, than open it in a text editor. Now enter the following into the text file: + ```xml + + + + + + + + + ``` +5. Save the file, and rename it to `NuGet.Config`. +6. If you don't see the sources in your IDE, try following this short guide and try again: [File Explorer (Windows); JSONLoader Wiki](https://github.com/Chaosyr/JSONCardLoaderWiki/wiki/JSON-and-CSV-Loader-API-Documentation-%E2%80%90-JSON-Inscrybing#file-explorer-windows). Simply put, your windows might not of overwrote the file extension because your extensions are hidden by default. If that fails try the `Via Package Source Configuration` method. -An alternative method to adding the API (and other mods) as a reference is to use NuGet packages by adding 'https://nuget.bepinex.dev/v3/index.json' as a package source, and then adding 'API_dev-API' as a reference. +
-With all this, you are now ready to begin creating your mod! -Some resources are provided below for you to use, including an example mod to look at for examples. -Otherwise, continue reading this wiki. +Now that we have this setup change the package source to `All`. Also ensure `Prerelease` is ticked on. -### Modding Resources -[Inscryption Modding Discord](https://discord.gg/QrJEF5Denm) +Next up, press `Browse` in the menu. Search up the following packages in the table below, than install the version specified to the solution, also ensure the source matches. -[BepInEx documentation](https://docs.bepinex.dev/) +| Package Name | Version | Source | +| :--------------------- | :--------: | ----------: | +| `BepInEx.Analyzers` | 1.0.8 | `BepInEx` | +| `BepInEx.Core` | 5.4.21 | `BepInEx` | +| `HarmonyX` | 2.10.2 | `nuget.org` | +| `Inscryption.GameLibs` | v1.9.0-r.0 | `BepInEx` | +| `UnityEngine.Modules` | v2019.4.24 | `BepInEx` | +| `API_dev-API` | 2.24.1 | `ts-nuget` | -[Harmony patching article](https://harmony.pardeike.net/articles/patching.html) +If you need any other dependencies that are mods on Thunderstore, search up its package identifier in the NuGet Search, for example `Nevernamed-Nevernameds_Sigilarium`. You can get the package identifier by going to the mods page on the Thunderstore Website, such as: [Nevernameds Sigilarium](https://thunderstore.io/c/inscryption/p/Nevernamed/Nevernameds_Sigilarium/). Beneath the Download, Like and Report Buttons, there will be a string of text resembling `Team-Name-Version`. You'll want to copy that string and remove the version part of it, that is what you will put in the NuGet Search. -[Example Mod using C#](https://github.com/debugman18/InscryptionExampleMod) +
-[Vanilla and Modded Enumerations](https://github.com/SaxbyMod/SabyModEnums) +You are now ready to begin creating your mod! Some resources are provided below for you to use, including an example mod to look at for examples. Otherwise, continue reading this wiki. \ No newline at end of file diff --git a/docs/wiki/getting_started/index.md b/docs/wiki/getting_started/index.md new file mode 100644 index 000000000..d0bfbde51 --- /dev/null +++ b/docs/wiki/getting_started/index.md @@ -0,0 +1,52 @@ +# Getting Started + +This set of articles covers getting started for both users and modders. This page acts as the homepage that links out to them. You can switch between them through the table of contents, which is on the left hand of the screen. You can also switch to other articles through the table of contents. + +___ + +## Getting Started (Users) + +The following are links to articles relevant for Users of the API. Namely covering the topic of installation of mods for Inscryption that utilize the API. This also includes how to install BepInEx, the underlying framework for all Inscryption Mods, for all the given scenarios the Articles tackle. + +***FOR LINUX AND STEAMDECK:*** Ensure that the game is set to run using `Proton` in the game settings on steam. Should be a setting like this: `Change launch behaviour` -> `Proton`. + +* [Installing With a Mod Manager](users/installing_with_a_mod_manager.md) +* [Installing Manually on Windows (x86)](users/installing_manually_on_windows_x86.md) +* [Installing Manually on Windows (x64)](users/installing_manually_on_windows_x64.md) +* [Installing on The Steam Deck](users/installing_on_the_steam_deck.md) +* [Installing on Mac & Linux](users/installing_on_mac_and_linux.md) + +___ + +## Getting Started (Modders) + +So your interested in learning how to modify Inscryption? Well this section of our guide should come in really handy for you! Albeit if your an artist, a developer, or just passing by, we hope you find these guides of value. + +First off let's get you to the right branch of the guides. Let's get some groundwork's out of the way now. Based on the item below, you should be funneled to the level your after. *Note for the IDE Question, if you have familiarity with [IntelliJ Idea](https://www.jetbrains.com/idea/), you'll likely prefer JetBrains Rider.* + +```mermaid +flowchart TD + A["Are you trying to make a Simple Cardpack?"] + A --> A1["If this item applied to you, than let's head to the
~~ JSONLoader Branch ~~
Unless your willing to challenge yourself?
If you want the challenge, follow the other tree!"] + + B["Are you after something more Complex in terms of your Project?"] + B --> C["Are you already familiar with C#?"] + + C -->|Yes| D["What is your preferred of the two? Visual Studio, or JetBrains Rider?"] + C -->|No| C1["If this was your case, than let's head into the
~~ C# Basics Branch ~~
To get you familiar with the underlying concepts,
and knowledge you will need in order to make your mod."] + + D -->|Visual Studio| D1["If this was your choice, let us navigate into the
~~ API Project Setup Guide for Visual Studio ~~"] + D -->|JetBrains Rider| D2["If this was your choice, let us navigate into the
~~ API Project Setup Guide for JetBrains Rider ~~"] + + click A1 "modders/jsonloader_projects/index.html" "Open JSONLoader Branch" + click C1 "modders/c_sharp_basics/index.html" "Open C# Basics Branch" + click D1 "modders/api_projects_vs_edition/index.html" "Open Visual Studio Setup Guide" + click D2 "modders/api_projects_rider_edition/index.html" "Open JetBrains Rider Setup Guide" +``` + +### Modding Resources +- [Inscryption Modding Discord](https://discord.gg/QrJEF5Denm) +- [BepInEx documentation](https://docs.bepinex.dev/) +- [Harmony patching article](https://harmony.pardeike.net/articles/patching.html) +- [Example Mod using C#](https://github.com/debugman18/InscryptionExampleMod) +- [Vanilla and Modded Enumerations](https://github.com/SaxbyMod/SabyModEnums) \ No newline at end of file diff --git a/docs/wiki/getting_started/modders/api_projects_rider_edition/index.md b/docs/wiki/getting_started/modders/api_projects_rider_edition/index.md new file mode 100644 index 000000000..2cbe55052 --- /dev/null +++ b/docs/wiki/getting_started/modders/api_projects_rider_edition/index.md @@ -0,0 +1 @@ +# API Projects (JetBrains Rider Edition) \ No newline at end of file diff --git a/docs/wiki/getting_started/modders/api_projects_rider_edition/toc.yml b/docs/wiki/getting_started/modders/api_projects_rider_edition/toc.yml new file mode 100644 index 000000000..f54cdfb30 --- /dev/null +++ b/docs/wiki/getting_started/modders/api_projects_rider_edition/toc.yml @@ -0,0 +1 @@ +items: \ No newline at end of file diff --git a/docs/wiki/getting_started/modders/api_projects_vs_edition/index.md b/docs/wiki/getting_started/modders/api_projects_vs_edition/index.md new file mode 100644 index 000000000..58bdd0e39 --- /dev/null +++ b/docs/wiki/getting_started/modders/api_projects_vs_edition/index.md @@ -0,0 +1 @@ +# API Projects (Visual Studio Edition) \ No newline at end of file diff --git a/docs/wiki/getting_started/modders/api_projects_vs_edition/toc.yml b/docs/wiki/getting_started/modders/api_projects_vs_edition/toc.yml new file mode 100644 index 000000000..f54cdfb30 --- /dev/null +++ b/docs/wiki/getting_started/modders/api_projects_vs_edition/toc.yml @@ -0,0 +1 @@ +items: \ No newline at end of file diff --git a/docs/wiki/getting_started/modders/c_sharp_basics/index.md b/docs/wiki/getting_started/modders/c_sharp_basics/index.md new file mode 100644 index 000000000..0cc5e9681 --- /dev/null +++ b/docs/wiki/getting_started/modders/c_sharp_basics/index.md @@ -0,0 +1 @@ +# C# Basics \ No newline at end of file diff --git a/docs/wiki/getting_started/modders/c_sharp_basics/toc.yml b/docs/wiki/getting_started/modders/c_sharp_basics/toc.yml new file mode 100644 index 000000000..f54cdfb30 --- /dev/null +++ b/docs/wiki/getting_started/modders/c_sharp_basics/toc.yml @@ -0,0 +1 @@ +items: \ No newline at end of file diff --git a/docs/wiki/getting_started/modders/index.md b/docs/wiki/getting_started/modders/index.md new file mode 100644 index 000000000..a42e17190 --- /dev/null +++ b/docs/wiki/getting_started/modders/index.md @@ -0,0 +1,34 @@ +# Getting Started (Modders) + +So your interested in learning how to modify Inscryption? Well this section of our guide should come in really handy for you! Albeit if your an artist, a developer, or just passing by, we hope you find these guides of value. + +First off let's get you to the right branch of the guides. Let's get some groundwork's out of the way now. Based on the item below, you should be funneled to the level your after. *Note for the IDE Question, if you have familiarity with [IntelliJ Idea](https://www.jetbrains.com/idea/), you'll likely prefer JetBrains Rider.* + +```mermaid +flowchart TD + A["Are you trying to make a Simple Cardpack?"] + A --> A1["If this item applied to you, than let's head to the
~~ JSONLoader Branch ~~
Unless your willing to challenge yourself?
If you want the challenge, follow the other tree!"] + + B["Are you after something more Complex in terms of your Project?"] + B --> C["Are you already familiar with C#?"] + + C -->|Yes| D["What is your preferred of the two? Visual Studio, or JetBrains Rider?"] + C -->|No| C1["If this was your case, than let's head into the
~~ C# Basics Branch ~~
To get you familiar with the underlying concepts,
and knowledge you will need in order to make your mod."] + + D -->|Visual Studio| D1["If this was your choice, let us navigate into the
~~ API Project Setup Guide for Visual Studio ~~"] + D -->|JetBrains Rider| D2["If this was your choice, let us navigate into the
~~ API Project Setup Guide for JetBrains Rider ~~"] + + click A1 "jsonloader_projects/index.html" "Open JSONLoader Branch" + click C1 "c_sharp_basics/index.html" "Open C# Basics Branch" + click D1 "api_projects_vs_edition/index.html" "Open Visual Studio Setup Guide" + click D2 "api_projects_rider_edition/index.html" "Open JetBrains Rider Setup Guide" +``` + +___ + +## Modding Resources +- [Inscryption Modding Discord](https://discord.gg/QrJEF5Denm) +- [BepInEx documentation](https://docs.bepinex.dev/) +- [Harmony patching article](https://harmony.pardeike.net/articles/patching.html) +- [Example Mod using C#](https://github.com/debugman18/InscryptionExampleMod) +- [Vanilla and Modded Enumerations](https://github.com/SaxbyMod/SabyModEnums) \ No newline at end of file diff --git a/docs/wiki/getting_started/modders/jsonloader_projects/basics_of_json.md b/docs/wiki/getting_started/modders/jsonloader_projects/basics_of_json.md new file mode 100644 index 000000000..4cab849f2 --- /dev/null +++ b/docs/wiki/getting_started/modders/jsonloader_projects/basics_of_json.md @@ -0,0 +1,35 @@ +# Basics of JSON + +So, knowledge of `JSON` is a core requirement of using JSONLoader. Thus, let's get you familiarized with what `JSON` is. First off `JSON` stands for `JavaScript Object Notation`, if the name didn't imply it already, it is a thing that originated from JavaScript. Not to be confused with Java, they are vastly different beasts. Anyways `JSON` is a Scripting Language, meant for expressing objects, such as what JSONLoader uses for its Cards. But before we can dig into that, first we need to introduce you to `JSON Syntax`. + +___ + +## Your First JSON + +To get started, let's create a new `JSON File`. Now open it in your text editor of preference. Next up, enter the following `{}`. Why? Well without them, the `JSON` won't actually read as a `JSON`, the curly braces (`{}`) act as the piece that tells the reader that the contents within the `{}` are a `Object`. To be precise the opening `{` opens the `Object`, and the closing `}` thus closes the object. + +What goes within these `{}` are called `Properties` and they define what the `Object` holds, the `Properties` themselves you can think of as defining what a piece of the `Object` is meant to do. A `Property` consists of a `Key` and a `Value`. The `Key` will always have the same syntax. The `Value` will change syntax based on the `Type` in which the `Property` pertains of. For example, a `String` and a `Boolean` will have different ways of defining its `Value`'s syntax, and by extension, what the `Value` of the `Property Key` can be. + +You can open a `Key` the same way you would an `Object`. Except with a `Key` you would use a pair of quotation marks (`""`). What goes within the quotation marks would be the `Property Key` in plaintext. When working with `JSON`, the `Schema` associated with the `JSON` will define what goes in the `Key`. A `Schema` is basically a set of rules that extend the rules of how a given `Property` can be defined, and can also be used to see what kind of `Value` is expected to go alongside a given `Property Key`. *Note: `Property Key`'s are case-sensitive, when defining one, ensure the casing matches the original `Key` found with the `Schema`.* + +Now there's a plethora of things you can format into this newly created `Object`. Open up your braces to look like the following code block, make sure there's a tab's worth of spacing in the middle. You won't be penalized if you don't but it will look better for the person who will end up reading the `JSON`. Within these braces is where we will be putting the `Properties`, as is expected by `JSON` syntax. + +```json +{ + +} +``` + +The following subsections will go over each `Property Type` that we can use when making a `JSON`. It will go over both what the rules of the `Property Type` are, a what the `Property Type` could be used for. + +### String + +### Integer + +### Boolean + +### Array + +### Object + +### Null \ No newline at end of file diff --git a/docs/wiki/getting_started/modders/jsonloader_projects/environment_setup.md b/docs/wiki/getting_started/modders/jsonloader_projects/environment_setup.md new file mode 100644 index 000000000..99108684c --- /dev/null +++ b/docs/wiki/getting_started/modders/jsonloader_projects/environment_setup.md @@ -0,0 +1,166 @@ +# Environment Setup + +First off we need to get some initial setup for the JSONLoader environment out of the way. The sections on this page, shown under `IN THIS ARTICLE` on the right hand side of the screen, will be focused on various aspects of setting up the environment. Why? We want to reduce the frictions you may run into when working with JSONLoader, before you run into them yourself. If you already have the environment you will be using setup, than feel free to skip ahead to the next article. + +___ + +## What Do I Need? + +First off you will need a Text Editor of some variety. A basic notepad can do the trick. However, if you want an easy to use system, which has syntax highlighting for both JSON and CSV, we recommend grabbing either [Visual Studio Code](https://code.visualstudio.com/download) or [Visual Studio Code Insiders](https://code.visualstudio.com/insiders). There is also a plethora of other editors that could work too, such as [Notepad++](https://notepad-plus-plus.org/downloads/), or [Atom](https://atom-editor.cc/). Once you've got the given editor you want to use installed/setup, we can proceed to the next section. + +___ + +## File Explorer Setup for Windows + +If your not a `Windows` user, skip this section. But if you are a `Windows` user, you'll want to follow it, that way we can ensure the file extensions, of the files your making will be the correct ones. The following steps will help you to enable File Explorer to show extensions of your files. + +1. First things first, you'll want to open your File Explorer, you can do this by pressing the `Windows` key, than searching for `File Explorer`, and lastly pressing `Open`. +2. Below the `Navbar` at the top of the window, press the button that looks like `…` or `three dots vertically centered and in a row`. +3. After having pressed the button, click on `Options` from the popup menu. +4. Once your in the menu, three tabs will be present at the top of the pop up, you will want to press the one labeled `View`. +5. Under `Advanced Settings` toggle the following setting off, `Hide extensions for known file types`, followed by toggling on `Show hidden files, folders, and drives`, this one is less needed, but it may come in handy when looking for your `AppData` folder if it ever becomes needed. +6. Now press `Apply to Folders` followed by `OK`. + +With that we are now set to proceed to the next section! If you ever find yourself unable to view your file extensions, just follow the above steps to fix it. + +___ + +## Fetching the Relevant Paths + +Next up we'll want to grab a few paths to use as a quick reference. If you ever need them you can also come back here for where they are as well. Namely we'll need to navigate to your game or profile's `plugins` folder a lot during development of your JSON/CSV Packs. + +### Mod Manager Installations + +For Mod Managers we need to navigate through the UI of the Mod Manager to navigate to the folder we'll need. Each of the following Subsections correlates with a given Mod Manager that can be used with the game, that we are officially supported through. + +#### R2ModMan + +For R2ModMan the process for getting there is as follows: + +1. Navigate to `Settings`. +2. Under `Settings` find `Directories` in the Left-Hand Table of Contents, than click it. +3. Find `Profile Folder` than press `Browse`, File Explorer (or an equivalent) should now be open. +4. For the `plugins` folder, navigate to `BepInEx` followed by `plugins`. +5. Now store the full path to this folder somewhere you can easily reference. + +#### Gale Mod Manager + +For Gale the process is as follows: + +1. Click `File` in the `Navbar`, than click on `Open Profile Folder`, File Explorer (or an equivalent) should be open. +2. For the `plugins` folder, navigate to `BepInEx` followed by `plugins`. +3. Now store the full path to this folder somewhere you can easily reference. + +#### Thunderstore Mod Manager + +For Thunderstore Mod Manager the process is pretty much the same as it would be for R2ModMan: + +1. Navigate to `Settings`. +2. Under `Settings` find `Directories` in the Left-Hand Table of Contents, than click it. +3. Find `Profile Folder` than press `Browse`, File Explorer (or an equivalent) should now be open. +4. For the `plugins` folder, navigate to `BepInEx` followed by `plugins`. +5. Now store the full path to this folder somewhere you can easily reference. + +### Manual Installations + +If your modding the game manually, first off refer to [Getting Started (Users)](../../users/index.md) for how to set up the basics. Make sure you have it setup correct otherwise the following steps won't align the greatest. + +1. Navigate to Inscryption's local install folder + * For XBOX Gamepass the path is roughly `C:\XboxGames\Inscryption\Content`, the drive may differ based on where you installed it to. + * For Steam first navigate to where your Steam is installed to, than follow this path `\steamapps\common\Inscryption`. +2. For the `plugins` folder, navigate to `BepInEx` followed by `plugins`. +3. Now store the full path to this folder somewhere you can easily reference. + +___ + +## Adding the JSON/CSV Loader File Extensions to the Context Menu on Windows 11 + +If your not on `Windows 11`, unfortunately this won't be able to apply to you, but if you find anything similar for your OS we could include, feel free to let us know that way we can add it. Anyways, the following is a `Registry File` that you can use to add the File Type's needed for JSON/CSV Loader directly in your `New File` under the `Windows Context Menu`. + +So first of all your going to want to create a new file, namely a text file. You can use Notepad or one of the aforementioned text editors for JSON Editing to do this. Once your in the new file, you'll want to paste the following into it. You can copy it by pressing the `Clipboard` icon in the top right corner of the code box. Note you don't need to have [Visual Studio Code](https://code.visualstudio.com/download) to use this, that's namely there for the purpose of giving you pretty icons for the filetypes. + +```ini +Windows Registry Editor Version 5.00 + +[HKEY_CLASSES_ROOT\.md] +@="markdownfile" + +[HKEY_CLASSES_ROOT\.md\ShellNew] +"NullFile"="" + +[HKEY_CLASSES_ROOT\markdownfile] +@="Markdown Document" + +[HKEY_CLASSES_ROOT\markdownfile\DefaultIcon] +@="\"C:\\Users\\Chaos\\AppData\\Local\\Programs\\Microsoft VSCode\\a44adf7f53\\resources\\app\\resources\\win32\\markdown.ico\"" + +[HKEY_CLASSES_ROOT\.json] +@="jsonfile" + +[HKEY_CLASSES_ROOT\.json\ShellNew] +"NullFile"="" + +[HKEY_CLASSES_ROOT\jsonfile] +@="JSON File" + +[HKEY_CLASSES_ROOT\jsonfile\DefaultIcon] +@="\"C:\\Users\\Chaos\\AppData\\Local\\Programs\\Microsoft VSCode\\a44adf7f53\\resources\\app\\resources\\win32\\json.ico\"" + +[HKEY_CLASSES_ROOT\.jldr] +@="jldrfile" + +[HKEY_CLASSES_ROOT\.jldr\ShellNew] +"NullFile"="" + +[HKEY_CLASSES_ROOT\jldrfile] +@="JSONLoader File" + +[HKEY_CLASSES_ROOT\jldrfile\DefaultIcon] +@="\"C:\\Users\\Chaos\\AppData\\Local\\Programs\\Microsoft VSCode\\a44adf7f53\\resources\\app\\resources\\win32\\json.ico\"" + +[HKEY_CLASSES_ROOT\.jldr2] +@="jldr2file" + +[HKEY_CLASSES_ROOT\.jldr2\ShellNew] +"NullFile"="" + +[HKEY_CLASSES_ROOT\jldr2file] +@="JSONLoader2 File" + +[HKEY_CLASSES_ROOT\jldr2file\DefaultIcon] +@="\"C:\\Users\\Chaos\\AppData\\Local\\Programs\\Microsoft VSCode\\a44adf7f53\\resources\\app\\resources\\win32\\json.ico\"" + +[HKEY_CLASSES_ROOT\.jldr3] +@="jldr3file" + +[HKEY_CLASSES_ROOT\.jldr3\ShellNew] +"NullFile"="" + +[HKEY_CLASSES_ROOT\jldr3file] +@="JSONLoader3 File" + +[HKEY_CLASSES_ROOT\jldr3file\DefaultIcon] +@="\"C:\\Users\\Chaos\\AppData\\Local\\Programs\\Microsoft VSCode\\a44adf7f53\\resources\\app\\resources\\win32\\json.ico\"" + +[HKEY_CLASSES_ROOT\.csv] +@="csvfile" + +[HKEY_CLASSES_ROOT\.csv\ShellNew] +"NullFile"="" + +[HKEY_CLASSES_ROOT\csvfile] +@="CSV File" + +[HKEY_CLASSES_ROOT\csvfile\DefaultIcon] +@="\"C:\\Users\\Chaos\\AppData\\Local\\Programs\\Microsoft VSCode\\a44adf7f53\\resources\\app\\resources\\win32\\html.ico\"" +``` + +Once you have that pasted into the new file, you'll want to save it as a `.reg` file, you can also rename it to have the `.reg` extension as well. The files name itself does not matter. Once you have it saved as a `.reg` file all you need to do now is run it. Which you can either do via right-click, or by double-clicking the file. For it to apply you'll want to restart your Windows Explorer via Task Manager. + +Now you should see the following File Type's appear when you go to make a new file: `Markdown File`, `CSV File`, `JSONLoader File`, `JSONLoader2 File`, `JSONLoader3 File`, and `JSON File`. The `JSONLoader(X) File` will be what you care about for current JSONLoader, namely the `JSONLoader2 File` for Stable, the rest are applicable for Nightly (including CSV). + +The `Markdown File` is included in this for the purposes of making your packages `README`, `CHANGELOG` and any other documentation you'd want to include. Your Package will be addressed in a later section of the Wiki. But for now, just note that you have it now. + +___ + +Alright now that we have the environment setup, press `Next` to proceed into the [Basics of JSON](basics_of_json.md). \ No newline at end of file diff --git a/docs/wiki/getting_started/modders/jsonloader_projects/index.md b/docs/wiki/getting_started/modders/jsonloader_projects/index.md new file mode 100644 index 000000000..9031a5f7e --- /dev/null +++ b/docs/wiki/getting_started/modders/jsonloader_projects/index.md @@ -0,0 +1,17 @@ +# JSONLoader Projects + +So you wound up taking the JSONLoader route? Well first off you should learn what exactly JSONLoader is. JSONLoader and by extension CSVLoader, is a tool primarily targeted towards Artists, or new Developers looking to get into modding Inscryption. It is a fantastic gateway for new users due to how simple it is to use and learn. This set of guides will act as a way for you to learn how to use JSONLoader for your projects. + +___ + +## JSONLoader Official Documentation + +JSONLoader's official documentation can be found in the following places, note Nightly refers to the Beta version, and Stable refers to the Main-Line version. +- Nightly GitHub Wiki: [GitHub Wiki](https://github.com/Chaosyr/JSONCardLoaderWiki/wiki) +- Nightly Thunderstore Wiki: [Thunderstore Wiki](https://thunderstore.io/c/inscryption/p/MADH95Mods/JSON_and_CSV_Loader_Nightly/wiki) +- Stable GitHub Wiki: [GitHub Wiki](https://github.com/MADH95/JSONLoader/wiki) +- Stable Thunderstore Wiki: [Thunderstore Wiki](https://thunderstore.io/c/inscryption/p/MADH95Mods/JSONCardLoader/wiki) + +___ + +Without further ado, press the `Next` button in the bottom bar of the screen to get started with our series of lessons on JSON, and JSON/CSV Loader. \ No newline at end of file diff --git a/docs/wiki/getting_started/modders/jsonloader_projects/toc.yml b/docs/wiki/getting_started/modders/jsonloader_projects/toc.yml new file mode 100644 index 000000000..0da8618c6 --- /dev/null +++ b/docs/wiki/getting_started/modders/jsonloader_projects/toc.yml @@ -0,0 +1,5 @@ +items: +- name: Environment Setup + href: environment_setup.md +- name: Basics of JSON + href: basics_of_json.md \ No newline at end of file diff --git a/docs/wiki/getting_started/modders/toc.yml b/docs/wiki/getting_started/modders/toc.yml new file mode 100644 index 000000000..ea9a90991 --- /dev/null +++ b/docs/wiki/getting_started/modders/toc.yml @@ -0,0 +1,13 @@ +items: +- name: JSONLoader Projects + href: jsonloader_projects/toc.yml + homepage: jsonloader_projects/index.md +- name: C# Basics + href: c_sharp_basics/toc.yml + homepage: c_sharp_basics/index.md +- name: API Projects (Visual Studio Edition) + href: api_projects_vs_edition/toc.yml + homepage: api_projects_vs_edition/index.md +- name: API Projects (JetBrains Rider Edition) + href: api_projects_rider_edition/toc.yml + homepage: api_projects_rider_edition/index.md \ No newline at end of file diff --git a/docs/wiki/getting_started/toc.yml b/docs/wiki/getting_started/toc.yml new file mode 100644 index 000000000..549d4a4b9 --- /dev/null +++ b/docs/wiki/getting_started/toc.yml @@ -0,0 +1,7 @@ +items: +- name: Getting Started (Users) + href: users/toc.yml + homepage: users/index.md +- name: Getting Started (Modders) + href: modders/toc.yml + homepage: modders/index.md \ No newline at end of file diff --git a/docs/wiki/getting_started/users/index.md b/docs/wiki/getting_started/users/index.md new file mode 100644 index 000000000..f4fd91204 --- /dev/null +++ b/docs/wiki/getting_started/users/index.md @@ -0,0 +1,11 @@ +# Getting Started (Users) + +The following are links to articles relevant for Users of the API. Namely covering the topic of installation of mods for Inscryption that utilize the API. This also includes how to install BepInEx, the underlying framework for all Inscryption Mods, for all the given scenarios the Articles tackle. + +***FOR LINUX AND STEAMDECK:*** Ensure that the game is set to run using `Proton` in the game settings on steam. Should be a setting like this: `Change launch behaviour` -> `Proton`. + +* [Installing With a Mod Manager](installing_with_a_mod_manager.md) +* [Installing Manually on Windows (x86)](installing_manually_on_windows_x86.md) +* [Installing Manually on Windows (x64)](installing_manually_on_windows_x64.md) +* [Installing on The Steam Deck](installing_on_the_steam_deck.md) +* [Installing on Mac & Linux](installing_on_mac_and_linux.md) \ No newline at end of file diff --git a/docs/wiki/getting_started/users/installing_manually_on_windows_x64.md b/docs/wiki/getting_started/users/installing_manually_on_windows_x64.md new file mode 100644 index 000000000..32bcb33a3 --- /dev/null +++ b/docs/wiki/getting_started/users/installing_manually_on_windows_x64.md @@ -0,0 +1,33 @@ +# Installing Manually on Windows (X64) + +1. Install [BepInEx](https://thunderstore.io/package/download/BepInEx/BepInExPack_Inscryption/5.4.2305/) by pressing `Manual Download` and extract the contents into a folder. **Do not extract into the game folder!** +2. Move the contents of the `BepInExPack_Inscryption` folder into the game folder (where the game executable is; usually found here: `C:\XboxGames\Inscryption\Content`). +3. Install the following package: [XboxSilencio](https://thunderstore.io/c/inscryption/p/CORE_API_TEAM/GamepassSilencio/), this is a package which aims to solve frictions with XBOX Gamepass specific installations, such as HueyFS related errors. +4. Run the game. If everything was done correctly, you will see the BepInEx console appear on your desktop. Close the game after it finishes loading. +5. Install [MonoModLoader](https://inscryption.thunderstore.io/package/BepInEx/MonoMod_Loader_Inscryption/) and extract the contents into a folder. +6. Move the contents of the `patchers` folder into `BepInEx/patchers` (If any of the mentioned BepInEx folders don't exist, just create them). +7. Install [Inscryption API](https://inscryption.thunderstore.io/package/API_dev/API/) and extract the contents into a folder. +8. Move the contents of the `plugins` folder into `BepInEx/plugins` and the contents of the `monomod` folder into the `BepInEx/monomod` folder. +9. Run the game again. If everything runs correctly, a message will appear in the console telling you that the API was loaded. +10. For any additional mods create a new subfolder. It can be called anything. Then, extract the zips archive into it. If there is a `BepInEx` folder within the zip instead drop the contents of that folder into the `BepInEx` root for the modding instance. EX; + ``` + BepInEx // These go within the BepInEx root folder + |-- config + |-- patchers + |-- plugins + |-- monomod + |-- core + plugins // Files within go into the created plugin subfolder that was created for the mod + |-- Art + |-- Scripts + |-- MyMod.dll + manifest.json // Ignorable, but if kept, goes in plugin subfolder + README.md // Ignorable, but if kept, goes in plugin subfolder + CHANGELOG.md // Ignorable, but if kept, goes in plugin subfolder + icon.png // Ignorable, but if kept, goes in plugin subfolder + ``` +11. Run the game once more and everything should be correct and working. + +If you have any issues with Steam Deck head over to the discord for this game: + +* **Inscryption Modding Discord:** [Here](https://discord.gg/ZQPvfKEpwM) \ No newline at end of file diff --git a/docs/wiki/getting_started/users/installing_manually_on_windows_x86.md b/docs/wiki/getting_started/users/installing_manually_on_windows_x86.md new file mode 100644 index 000000000..898266f1d --- /dev/null +++ b/docs/wiki/getting_started/users/installing_manually_on_windows_x86.md @@ -0,0 +1,32 @@ +# Installing Manually on Windows (X86) + +1. Install [BepInEx](https://thunderstore.io/package/download/BepInEx/BepInExPack_Inscryption/5.4.2305/) by pressing `Manual Download` and extract the contents into a folder. **Do not extract into the game folder!** +2. Move the contents of the `BepInExPack_Inscryption` folder into the game folder (where the game executable is; usually found here: `C:\Program Files (x86)\Steam\steamapps\common\Inscryption`). +3. Run the game. If everything was done correctly, you will see the BepInEx console appear on your desktop. Close the game after it finishes loading. +4. Install [MonoModLoader](https://inscryption.thunderstore.io/package/BepInEx/MonoMod_Loader_Inscryption/) and extract the contents into a folder. +5. Move the contents of the `patchers` folder into `BepInEx/patchers` (If any of the mentioned BepInEx folders don't exist, just create them). +6. Install [Inscryption API](https://inscryption.thunderstore.io/package/API_dev/API/) and extract the contents into a folder. +7. Move the contents of the `plugins` folder into `BepInEx/plugins` and the contents of the `monomod` folder into the `BepInEx/monomod` folder. +8. Run the game again. If everything runs correctly, a message will appear in the console telling you that the API was loaded. +9. For any additional mods create a new subfolder. It can be called anything. Then, extract the zips archive into it. If there is a `BepInEx` folder within the zip instead drop the contents of that folder into the `BepInEx` root for the modding instance. EX; + ``` + BepInEx // These go within the BepInEx root folder + |-- config + |-- patchers + |-- plugins + |-- monomod + |-- core + plugins // Files within go into the created plugin subfolder that was created for the mod + |-- Art + |-- Scripts + |-- MyMod.dll + manifest.json // Ignorable, but if kept, goes in plugin subfolder + README.md // Ignorable, but if kept, goes in plugin subfolder + CHANGELOG.md // Ignorable, but if kept, goes in plugin subfolder + icon.png // Ignorable, but if kept, goes in plugin subfolder + ``` +10. Run the game once more and everything should be correct and working. + +If you have any issues with Manual head over to the discord for this game: + +* **Inscryption Modding Discord:** [Here](https://discord.gg/ZQPvfKEpwM) \ No newline at end of file diff --git a/docs/wiki/getting_started/users/installing_on_mac_and_linux.md b/docs/wiki/getting_started/users/installing_on_mac_and_linux.md new file mode 100644 index 000000000..581198f0a --- /dev/null +++ b/docs/wiki/getting_started/users/installing_on_mac_and_linux.md @@ -0,0 +1,39 @@ +# Installing on Mac & Linux + +***FOR LINUX:*** Ensure that the game is set to run using `Proton` in the game settings on steam. Should be a setting like this: `Change launch behaviour` -> `Proton`. + +***FOR CACHYOS LINUX:*** Ensure your Proton is set specifically to `11.0-20261015`, the name important part appears to be having it on Proton `11`. + +***Mod Managers:*** There are two mod managers you can use for Linux; [Gale](https://thunderstore.io/c/inscryption/p/Kesomannen/GaleModManager/), or [Pulsar](https://pulsarmods.com/), however Pulsar is the only one in that prior list will work with MacOS, in present. If neither work for you, the manual instructions are below. + +1. Follow the steps here first: [BepInEx Installation Guide](https://docs.bepinex.dev/articles/user_guide/installation/index.html?tabs=tabid-nix). +2. Run the game. If everything was done correctly, you will see the BepInEx console appear on your desktop. Close the game after it finishes loading. +3. Install [MonoModLoader](https://inscryption.thunderstore.io/package/BepInEx/MonoMod_Loader_Inscryption/) and extract the contents into a folder. +4. Move the contents of the `patchers` folder into `BepInEx/patchers` (If any of the mentioned BepInEx folders don't exist, just create them). +5. Install [Inscryption API](https://inscryption.thunderstore.io/package/API_dev/API/) and extract the contents into a folder. +6. Move the contents of the `plugins` folder into `BepInEx/plugins` and the contents of the `monomod` folder into the `BepInEx/monomod` folder. +7. Run the game again. If everything runs correctly, a message will appear in the console telling you that the API was loaded. +8. For any additional mods create a new subfolder. It can be called anything. Then, extract the zips archive into it. If there is a `BepInEx` folder within the zip instead drop the contents of that folder into the `BepInEx` root for the modding instance. EX; + ``` + BepInEx // These go within the BepInEx root folder + |-- config + |-- patchers + |-- plugins + |-- monomod + |-- core + plugins // Files within go into the created plugin subfolder that was created for the mod + |-- Art + |-- Scripts + |-- MyMod.dll + manifest.json // Ignorable, but if kept, goes in plugin subfolder + README.md // Ignorable, but if kept, goes in plugin subfolder + CHANGELOG.md // Ignorable, but if kept, goes in plugin subfolder + icon.png // Ignorable, but if kept, goes in plugin subfolder + ``` +9. Run the game once more and everything should be correct and working. + +If you have any issues with Mac/Linux head over to the discord for this game (or if a Mod Manager is used the Mod Manager's Support Discord): + +* **Inscryption Modding Discord:** [Here](https://discord.gg/ZQPvfKEpwM) +* **Gale Mod Manager Support Discord:** [Here](https://discord.gg/sfuWXRfeTt) +* **Pulsar Support Discord:** [Here](https://pulsarmods.com/discord) \ No newline at end of file diff --git a/docs/wiki/getting_started/users/installing_on_the_steam_deck.md b/docs/wiki/getting_started/users/installing_on_the_steam_deck.md new file mode 100644 index 000000000..563f7edb2 --- /dev/null +++ b/docs/wiki/getting_started/users/installing_on_the_steam_deck.md @@ -0,0 +1,16 @@ +# Installing on the Steam Deck + +***FOR STEAMDECK:*** Ensure that the game is set to run using `Proton` in the game settings on steam. Should be a setting like this: `Change launch behaviour` -> `Proton`. + +1. Download [r2modman](https://thunderstore.io/c/inscryption/p/ebkr/r2modman/) on the Steam Deck's Desktop Mode and open it from its download using its `AppImage` file. +2. Download the mods you plan on using and their dependencies. +3. Go to the setting of the profile you are using for the mods and click `Browse Profile Folder`. +4. Copy the BepInEx folder, then go to Steam and open Inscryption's Properties menu +5. Go to `Installed Files` click `Browse` to open the folder containing Inscryption's local files; paste the BepInEx folder there. +6. Enter Gaming Mode and check 'Force the use of a specific Steam Play compatibility tool' in the Properties menu under `Compatibility`. +7. Go to the launch parameters and enter `WINEDLLOVERRIDES="winhttp.dll=n,b" %command%`. +8. Open Inscryption. If everything was done correctly, you should see a console appear on your screen. + +If you have any issues with Steam Deck head over to the discord for this game: + +* **Inscryption Modding Discord:** [Here](https://discord.gg/ZQPvfKEpwM) \ No newline at end of file diff --git a/docs/wiki/getting_started/users/installing_with_a_mod_manager.md b/docs/wiki/getting_started/users/installing_with_a_mod_manager.md new file mode 100644 index 000000000..1941d3928 --- /dev/null +++ b/docs/wiki/getting_started/users/installing_with_a_mod_manager.md @@ -0,0 +1,12 @@ +# Installing with a Mod Manager + +1. Download and install [Thunderstore Mod Manager](https://www.overwolf.com/app/Thunderstore-Thunderstore_Mod_Manager), [Gale](https://thunderstore.io/c/inscryption/p/Kesomannen/GaleModManager/), [Pulsar](https://pulsarmods.com/) or [r2modman](https://thunderstore.io/c/inscryption/p/ebkr/r2modman/). +2. Click the **Install with Mod Manager** button on the top of [BepInEx's](https://thunderstore.io/c/inscryption/p/BepInEx/BepInExPack_Inscryption/) page. +3. Run the game via the mod manager. + +If you have issues with Mod Managers head to one of these discords; + +* **Thunderstore Support Discord:** [Here](https://discord.gg/Fbz54kQAxg) +* **R2ModMan Support Discord:** [Here](https://discord.gg/R85wjqa4WN) +* **Gale Mod Manager Support Discord:** [Here](https://discord.gg/sfuWXRfeTt) +* **Pulsar Support Discord:** [Here](https://pulsarmods.com/discord) \ No newline at end of file diff --git a/docs/wiki/getting_started/users/toc.yml b/docs/wiki/getting_started/users/toc.yml new file mode 100644 index 000000000..009798e44 --- /dev/null +++ b/docs/wiki/getting_started/users/toc.yml @@ -0,0 +1,11 @@ +items: +- name: Installing With a Mod Manager + href: installing_with_a_mod_manager.md +- name: Installing Manually on Windows (x86) + href: installing_manually_on_windows_x86.md +- name: Installing Manually on Windows (x64) + href: installing_manually_on_windows_x64.md +- name: Installing on The Steam Deck + href: installing_on_the_steam_deck.md +- name: Installing on Mac & Linux + href: installing_on_mac_and_linux.md \ No newline at end of file diff --git a/docs/wiki/index.md b/docs/wiki/index.md index a61a9a56b..64645b87c 100644 --- a/docs/wiki/index.md +++ b/docs/wiki/index.md @@ -1,12 +1,22 @@ -## Inscryption Modding Wiki ---- -Welcome to the modding wiki! This document will help familiarise you with modding Inscryption using the Inscryption API. -Here you will find in-depth information on the API's numerous features, both what they do and how you can use them. +# Inscryption Modding Wiki -For a full list of API classes and members, or are looking for more technical information, you can look at the documentation section. +Hey there, and welcome to the Inscryption Modding and API Wiki. This is your one stop hub for all things related to the API. The following are some quick links: + +* [Inscryption API Documentation](../api/index.md) +* [Inscryption Community Patch Documentation](../community/index.md) +* [Inscryption Modding Wiki](../wiki/index.md) + +Some other links you may find extremely valuable are as follows: +* [Inscryption Modding Discord](https://discord.gg/QrJEF5Denm) +* [Thunderstore Package](https://thunderstore.io/c/inscryption/p/API_dev/API/) +* [GitHub Repository](https://github.com/InscryptionModding/InscryptionAPI) + +How can you contribute to the wiki? Well for starters you can find the Wiki end of our setup [here](https://github.com/InscryptionModding/InscryptionAPI/tree/main/docs), the only relevant part of this setup you may need to interact with is `wiki` or any `index.md` files. The rest of it leave untouched unless you ***know*** what you are doing. Once you have a Markdown file open its straightforward editing as long as you know how Markdown works. + +___ ## Game Tweaks ---- + Included with the API are a number of game changes for aiding with multi-Act support and further modding customisation. The API package also comes with a second DLL consisting of multiple community patches, either fixing bugs or providing QoL changes for the game. @@ -29,7 +39,7 @@ EnergyDrone.ZoneConfigs[CardTemple.Nature].ConfigMox = true; // Enables Mox mana EnergyDrone.ZoneConfigs[CardTemple.Nature].ConfigDroneMox = true; // Makes the Mox drone appear ``` -Currently, the only zones where these settings will have any effect are CardTemple.Nature (Leshy's cabin) and CardTemple.Undead (Grimora's cabin). +Currently, the only zones where these settings will have any effect are `CardTemple.Nature` (Leshy's cabin) and `CardTemple.Undead` (Grimora's cabin). ### Bones Display in Act Three / P03 in Kaycee's Mod With the API installed, a separate bones displayer can be made available in Act 3. It will appear automatically if any cards with a bones cost are in the Act 3 card pool, and can be forced to appear by modifying the configuration for the API. This displayer appears as a TV screen hanging on the resource drone below the Gems module. @@ -44,47 +54,53 @@ Act3BonesDisplayer.ForceBonesDisplayActive = true; // Forces the bones TV screen If the bones TV screen is active, a bolt will also be dropped on top of each card that dies in-game (the same way that bone tokens are dropped on top of cards that die in Leshy's cabin). -### DeathShield Ability Behaviour -The API changes how DeathShield (aka Nano Armour/Armoured) functions, with the ability now being attached to a custom ability behaviour 'APIDeathShield' that inherits from DamageShieldBehaviour (more info further below). +### `DeathShield` Ability Behaviour +The API changes how `DeathShield` (aka Nano Armour/Armoured) functions, with the ability now being attached to a custom ability behaviour `APIDeathShield` that inherits from `DamageShieldBehaviour` (more info further below). + +___ ## Extra Alternate Portraits ---- + In Inscryption, there are some situations where a card's portrait is changed. -SteelTrap, for example, changes the base card's portrait to the 'closed trap' portrait, and Mud Turtle switches its portrait upon losing its shield. -However, these cases are very limited; SteelTrap changes *all* cards to the closed trap portrait, even if it's not on the vanilla trap card; +`SteelTrap`, for example, changes the base card's portrait to the 'closed trap' portrait, and Mud Turtle switches its portrait upon losing its shield. +However, these cases are very limited; `SteelTrap` changes *all* cards to the closed trap portrait, even if it's not on the vanilla trap card; and only Mud Turtle can change its portrait upon losing its shield. -So the API changes this. Each added CardInfo can now be assigned custom sprites specific to the effects of SteelTrap and losing a shield, using SetSteelTrapPortrait() and SetBrokenShieldPortrait() respectively. +So the API changes this. Each added CardInfo can now be assigned custom sprites specific to the effects of `SteelTrap` and losing a shield, using `SetSteelTrapPortrait()` and `SetBrokenShieldPortrait()` respectively. These are stored separately from a card's base portrait and alternate portrait, giving you greater freedom in what cards you can make. -|Name |Description |Setter Methods | -|---------------------------|---------------------------------------------------------------------------------------|---------------------------| -|PixelAlternatePortrait |The portrait used when calling SwitchToAlternatePortrait in Act 2. |SetPixelAlternatePortrait | -|SteelTrapPortrait |The portrait used when the Steel Trap sigil activates. |SetSteelTrapPortrait, SetEmissiveSteelTrapPortrait, SetPixelSteelTrapPortrait | -|BrokenShieldPortrait |The portrait used when this card has lost all of its shields. |SetBrokenShieldPortrait, SetEmissiveBrokenShieldPortrait, SetPixelBrokenShieldPortrait | -|SacrificablePortrait |The portrait used when this card is on the board and the player is choosing sacrifices.|SetSacrificablePortrait, SetEmissiveSacrificablePortrait, SetPixelSacrificablePortrait | +| Name | Description | Setter Methods | +| ---------------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `PixelAlternatePortrait` | The portrait used when calling `SwitchToAlternatePortrait` in Act 2. | `SetPixelAlternatePortrait` | +| `SteelTrapPortrait` | The portrait used when the Steel Trap sigil activates. | `SetSteelTrapPortrait`, `SetEmissiveSteelTrapPortrait`, `SetPixelSteelTrapPortrait` | +| `BrokenShieldPortrait` | The portrait used when this card has lost all of its shields. | `SetBrokenShieldPortrait`, `SetEmissiveBrokenShieldPortrait`, `SetPixelBrokenShieldPortrait` | +| `SacrificablePortrait` | The portrait used when this card is on the board and the player is choosing sacrifices. | `SetSacrificablePortrait`, `SetEmissiveSacrificablePortrait`, `SetPixelSacrificablePortrait` | + +___ -## Part2Modular -The API adds a custom AbilityMetaCategory called Part2Modular, accessible from the AbilityManager. +## `Part2Modular` +The API adds a custom `AbilityMetaCategory` called `Part2Modular`, accessible from the `AbilityManager`. -This metacategory is used in the community patches to determine what sigils the Amorphous sigil can become while in Act 2, but is otherwise free for you to use. +This meta category is used in the community patches to determine what sigils the Amorphous sigil can become while in Act 2, but is otherwise free for you to use. -A number of vanilla sigils have been marked with this metacategory by default. +A number of vanilla sigils have been marked with this meta category by default. + +___ ## Core Features ---- + ### Extending Enumerations -The base game uses a number of hard-coded lists, called 'Enumerations' or 'Enums', to manage behaviors. For example, the ability "Brittle" is assigned to a card using the enumerated value Ability.Brittle. We can expand these lists, but it requires care, and it is managed by the GuidManager class. This handles the creation of new enumerations and making sure those are handled consistently across mods. +The base game uses a number of hard-coded lists, called 'Enumerations' or 'Enums', to manage behaviors. For example, the ability "Brittle" is assigned to a card using the enumerated value Ability.Brittle. We can expand these lists, but it requires care, and it is managed by the `GuidManager` class. This handles the creation of new enumerations and making sure those are handled consistently across mods. -Lets say that you want to create a new story event. These are managed by the enumeration StoryEvent. To create a new story event, you should use this pattern to create a single static reference to that new value: +Let's say that you want to create a new story event. These are managed by the enumeration `StoryEvent`. To create a new story event, you should use this pattern to create a single static reference to that new value: ```c# public static readonly StoryEvent MyEvent = GuidManager.GetEnumValue(MyPlugin.guid, "MyNewStoryEvent"); ``` -GuidManager requires you to give it the GUID of your plugin as well as a friendly name for the value you want to create (the plugin GUID is required to avoid issues if multiple mods try to create a new value with the same name). +`GuidManager` requires you to give it the `GUID` of your plugin as well as a friendly name for the value you want to create (the plugin `GUID` is required to avoid issues if multiple mods try to create a new value with the same name). -If you want to get a value that was created by another mod (for example: you want to make a card that uses an ability created by another mod), you can follow this exact same pattern. You just need to know the plugin GUID for the mod that it is contained in: +If you want to get a value that was created by another mod (for example: you want to make a card that uses an ability created by another mod), you can follow this exact same pattern. You just need to know the plugin `GUID` for the mod that it is contained in: ```c# public static readonly Ability OtherAbility = GuidManager.GetEnumValue("other.mod.plugin.guid", "Ability Name"); @@ -93,7 +109,7 @@ public static readonly Ability OtherAbility = GuidManager.GetEnumValue( All of these values are stored in the modded save file. ### Custom Game Save Data -If your mod needs to save data, the ModdedSaveManager class is here to help. There are two chunks of extra save data that you can access here: 'SaveData' (which persists across runs) and 'RunState' (which is reset on every run). Note that these require you to pass in a GUID, which should be your mod's plugin GUID, and an arbitrary key, which you can select for each property to you want to save. +If your mod needs to save data, the `ModdedSaveManager` class is here to help. There are two chunks of extra save data that you can access here: `SaveData` (which persists across runs) and `RunState` (which is reset on every run). Note that these require you to pass in a GUID, which should be your mod's plugin GUID, and an arbitrary key, which you can select for each property to you want to save. The easiest way to use these helpers is to map them behind static properties, like so: diff --git a/docs/wiki/items.md b/docs/wiki/items.md index 24c942353..74dab0ae5 100644 --- a/docs/wiki/items.md +++ b/docs/wiki/items.md @@ -1,9 +1,9 @@ -## Custom Items ---- +# Custom Items + The API supports adding custom consumable items. -To create an item, you will need to create a new class that inherits from ConsumableItem. +To create an item, you will need to create a new class that inherits from `ConsumableItem`. -Specify the class for your item and what happens when its used. +Specify the class for your item and what happens when it's used. ```csharp public class CustomConsumableItem : ConsumableItem { @@ -28,8 +28,8 @@ public class CustomConsumableItem : ConsumableItem } ``` -## Adding your New Item -If you don't have a custom model you can use one of the default types from ConsumableItemManager.ModelType provided by the API. +## Adding Your New Item +If you don't have a custom model you can use one of the default types from `ConsumableItemManager.ModelType` provided by the API. ```csharp ConsumableItemManager.ModelType modelType = ConsumableItemManager.ModelType.Basic; @@ -38,7 +38,7 @@ ConsumableItemManager.New(Plugin.PluginGuid, "Custom Item", "Does a thing!", tex .SetAct1(); ``` -If you want to create a simple 'card-in-a-bottle' type item, you can use the provided method like so: +If you want to create a simple `card-in-a-bottle` type item, you can use the provided method like so: ```csharp ConsumableItemManager.NewCardInABottle(PluginGuid, cardInfo.name) .SetAct1(); @@ -52,4 +52,4 @@ ConsumableItemManager.New(Plugin.PluginGuid, "Custom Item", "Does a thing!", tex .SetAct1(); ``` -If you want your item to appear in the rulebook in multiple Acts, use the extension `AddExtraRulebookCategories` on the returned ConsumableItemData. \ No newline at end of file +If you want your item to appear in the rulebook in multiple Acts, use the extension `AddExtraRulebookCategories` on the returned `ConsumableItemData`. \ No newline at end of file diff --git a/docs/wiki/localisation.md b/docs/wiki/localisation.md index 3a62ea267..d510dc3a4 100644 --- a/docs/wiki/localisation.md +++ b/docs/wiki/localisation.md @@ -1,40 +1,40 @@ -## Localisation ---- +# Localization + While Inscryption already provides translations for a number of languages, these only apply to the base game's text, meaning any modded content is stuck in the language it was written in. To alleviate this problem, the API provides support for adding new translations and even new languages. -### Adding new Translations -If you want to add your own translations to Inscryption you can use the API's localisation system. +## Adding New Translations +If you want to add your own translations to Inscryption you can use the API's localization system. ```csharp LocalizationManager.Translate("MyModGUID", null, "Hello", "안녕하세요", Language.Korean); ``` -## Default languages ---- +## Default Languages + The default supported languages are listed in the table below. | Suffix | Language | |--------|-------------| -| fr | French | -| it | Italian | -| de | German | -| es | Spanish | -| pt | Portuguese | -| tr | Turkish | -| ru | Russian | -| ja | Japanese | -| ko | Korean | -| zhcn | Chinese (Simplified) | -| zhtw | Chinese (Traditional)| - -### Adding new Languages -If you want to translate into an unsupported language, you can add a new langauge and translation like so: +| `fr` | French | +| `it` | Italian | +| `de` | German | +| `es` | Spanish | +| `pt` | Portuguese | +| `tr` | Turkish | +| `ru` | Russian | +| `ja` | Japanese | +| `ko` | Korean | +| `zhcn` | Chinese (Simplified) | +| `zhtw` | Chinese (Traditional)| + +## Adding New Languages +If you want to translate into an unsupported language, you can add a new language and translation like so: ```csharp LocalizationManager.NewLanguage("MyModGUID", "Polish", "PL", "Reset With Polish", pathToCSV); ``` -Your language file must be a .csv, and formatted in the following way so the API can read it properly: +Your language file must be a `.csv`, and formatted in the following way so the API can read it properly: ``` Column1,Column10,PL TALKING_STOAT_DIALOGUE_STOATSACRIFICE_REPEAT_#2_852_M,Again...,Ponownie... diff --git a/docs/wiki/map.md b/docs/wiki/map.md index 69603d28f..90925ae1f 100644 --- a/docs/wiki/map.md +++ b/docs/wiki/map.md @@ -1,15 +1,16 @@ -## Custom Maps and Encounters ---- +# Custom Maps and Encounters + Unlike abilities, encounters are encoded into the game's data through a combination of enumerations and strings. For example, Opponents are enumerated by the enumeration Opponent.Type, but special sequencers and unique AI rules are represented as strings buried in each encounters data. To create a custom encounter (for example, a custom boss fight), you will need some combination of opponents, special sequencers, and AI. -### Encounter Turn Plans +## Encounter Turn Plans When you're creating an encounter, you'll want to also create a turn plan that determines what cards are played during the encounter. The API adds a number of methods to make this process easier for you. In this example, we will create a turn plan that is 14 turns long with the following card sequence: +``` Turn 1 - Play 2 Bonehounds; the slots they spawn in are chosen by the game; you have no control of it when making a turn plan Turn 2 - Play nothing Turn 3 - Play nothing @@ -18,6 +19,7 @@ Turn 5 - Play 1 Bonepile that is replaced with a Bonehound at difficulties >= 10 Turn 6 - Play nothing Turn 7 - Play 1 Bonepile Repeat turns 1-7 one time. +``` ```c# using static InscryptionAPI.Encounters.EncounterManager; @@ -42,122 +44,26 @@ private void AddEncounters() ``` The following methods are provided for convenience: -- **New:** Creates a new instance of EncounterBlueprintData and adds it to the API (does not add the EBD to any regions). -- **NewCardBlueprint:** Creates a new CardBlueprint. -- **CreateTurn:** Creates a new List\ that represents a single turn in an encounter's turn plan. Can pass card names through or CardBlueprints, or nothing if you want an empty turn. +- **`New`:** Creates a new instance of `EncounterBlueprintData` and adds it to the API (does not add the `EBD` to any regions). +- **`NewCardBlueprint`:** Creates a new `CardBlueprint`. +- **`CreateTurn`:** Creates a new `List` that represents a single turn in an encounter's turn plan. Can pass card names through or `CardBlueprints`, or nothing if you want an empty turn. The following extensions are available for making turn plans, sorted by what class they affect: -- EncounterBlueprintData - - **SetDifficulty:** Sets the minimum and maximum difficulties at which the encounter can be used. - - **AddDominantTribes:** Used in Totem battles to determine the potential Totem top that will be used. - - **SetRegionSpecific:** Unused by the game, just here for posterity (unless you want to use it for something yourself). - - **AddRandomReplacementCards:** When making a card blueprint, you can set whether the card can be randomly replaced. This field determines the cards that can potentially replace that card. - - **SetRedundantAbilities:** Sets what abilities can't be chosen by Leshy to be used for his totem during Totem battles. - - **SetUnlockedCardPrerequisites:** Sets what cards have to be unlocked in order to be used in this encounter. - - **AddTurnMods:** Used in Part 3 to overclock played cards above the specified difficulty on the specified turn. - - **AddTurn:** Adds a turn to the turn plan. - - **AddTurns:** Adds turns to the turn plan. - - **DuplicateTurns:** Duplicates all turns currently in the turn plan by the specified amount. - - **SyncDifficulties:** Sets the minimum and maximum difficulties of all cards in the turn plan. -- CardBlueprint - - **SetDifficulty:** Sets the minimum and maximum difficulties at which this card can be played. - - **SetReplacement:** Sets the card that will replace the base card at and above the specified difficulty. -- List\ - - **SetTurnDifficulty:** Sets the minimum and maximum difficulties of each card in the list. - - **DuplicateTurn:** Duplicates the list the specified number of times. Designed to be used with EncounterBlueprintData.AddTurns(). - -## Adding Map Nodes ---- -When adding a custom node to the game map, be prepared to implement potentially complex game logic. -Every new node requires a 'sequencer' class, which controls the event that happens when you enter a map node. -This includes the creation of game objects, animation of objects, manipulating the player's deck, and everything else you may want the map node to do. - -Your sequencer class must implement the API's `ICustomNodeSequencer` interface, otherwise the API will have difficulty executing the event correctly. -The API provides a couple template sequencer classes to make this easier for you: `CustomNodeSequencer` and `CustomCardChoiceNodeSequencer`. - -The former is a basic abstract class that simply implements the above interface as well as every other node-related interface in the API. -The latter class is intended for custom card choice nodes. - -**It's highly recommended that you decompile the game's node sequencer classes to get a feel of how they work.** - -Along with a sequencer, you will need to create an animation so the node will appear on the map. -This takes the form of an array of exactly four textures, each sized at 49x49 pixels. -Each of these textures should be similar to each other if you want to mimic the 'shakiness' of the game's nodes. - -With all these pieces, the final step is to register your custom node with the API: -```c# -Assembly asm = typeof(MyCustomSequencer).Assembly; - -NewNodeManager.New( - "MyPluginGUID", "MyCustomNode", - GenerationType.SpecialEvent, typeof(MyCustomSequencer), - new List { - TextureHelper.GetImageAsTexture("animated_node_1.png", asm), - TextureHelper.GetImageAsTexture("animated_node_2.png", asm), - TextureHelper.GetImageAsTexture("animated_node_3.png", asm), - TextureHelper.GetImageAsTexture("animated_node_4.png", asm) - } -); -``` - -GenerationType is a flag-style enumeration that tells the API where the node should appear. -Flag-style means that multiple values can be combined using the bitwise-or operator (|). -For example, if you want the node to randomly appear before a battle, but also be forced to appear directly before the boss, -you can use this combination: -```c# -GenerationType.SpecialEvent | GenerationType.PreBoss -``` - -The values of GenerationType are: - -- **None:** This node will not be autogenerated on the map, but can still be manually added (for example, if you are manually manipulating Act 3 maps). -- **SpecialCardChoice:** This node will appear in the pool of random events that happen right after a battle. -- **SpecialEvent:** This node will appear in the pool of random events that happen right before a battle. -- **RegionStart:** This node will be forced to appear at the start of each map, unless the node fails a prerequisite condition. -- **PreBoss:** This node will be forced to appear right before the boss of each map, unless the node fails a prerequisite condition -- **PostBoss:** This node will be forced to appear right after the boss of each map, unless the node fails a prerequisite condition - -### Conditional Nodes -Map nodes can implement logic that determines whether or not they are generated on the map. -This is done using the `SelectionCondition` class, and when registering your node you'll have the ability to give it SelectionConditions that control its generation logic. - -There are two condition types: prerequisite and forced generation. -The former prevents a node from generating if any condition return false, and the latter forces a node to generate if any condition returns true; - -The game comes prepackaged with several premade SelectionConditions, but you can also create your own. - -Base SelectionConditions: -- **CardsInDeckTraits:** Checks if any cards in your deck have the given Trait, can be used as a blacklist or whitelist. -- **EitherOr:** Checks if either of the given SelectionConditions were satisified. -- **IsAscension:** Checks if the player is playing Kaycee's Mod. -- **PastRunsCompleted:** Checks if the given integer is greater or equal to the number of previous completed runs. -- **PreviousNodesContent:** Checks if the list of all previous map nodes contains the given NodeType, can be used as a blacklist or whitelist. -- **PreviousRowContent:** Checks if the previous row of map nodes contains the given NodeType, can be used as a blacklist or whitelist. -- **StoryEventCompleted:** Checks if the given StoryEvent has been completed. -- **WithinGridYRange:** Checks if the current map node location is within the given range. - -The API also adds two custom SelectionConditions: -- **ChallengeIsActive:** Checks if the given Challenge is active, can be used as a blacklist or whitelist. -- **NumChallengesOfTypeActive:** Compares the given integer to the number of active challenges of the given Type based on the value of `greaterThanNumActive`. - -Here is a code sample: -```c# -Assembly asm = typeof(MyCustomSequencer).Assembly; - -NewNodeManager.New( - "MyPluginGUID", "MyCustomNode", - GenerationType.SpecialEvent, typeof(MyCustomSequencer), - new List { - TextureHelper.GetImageAsTexture("animated_node_1.png", asm), - TextureHelper.GetImageAsTexture("animated_node_2.png", asm), - TextureHelper.GetImageAsTexture("animated_node_3.png", asm), - TextureHelper.GetImageAsTexture("animated_node_4.png", asm) - }, - new List { - new ChallengeIsActive(AscensionChallenge.BaseDifficulty, exclude: true) // prevent generation if there are no BaseDifficulty challenges active. - }, - new List { - new NumChallengesOfTypeActive(AscensionChallenge.BaseDifficulty, 2, greaterThanNumActive: false) // force generation if there are 2 or more BaseDifficulty challenges active. - } -); -``` \ No newline at end of file +- `EncounterBlueprintData` + - **`SetDifficulty`:** Sets the minimum and maximum difficulties at which the encounter can be used. + - **`AddDominantTribes`:** Used in Totem battles to determine the potential Totem top that will be used. + - **`SetRegionSpecific`:** Unused by the game, just here for posterity (unless you want to use it for something yourself). + - **`AddRandomReplacementCards`:** When making a card blueprint, you can set whether the card can be randomly replaced. This field determines the cards that can potentially replace that card. + - **`SetRedundantAbilities`:** Sets what abilities can't be chosen by Leshy to be used for his totem during Totem battles. + - **`SetUnlockedCardPrerequisites`:** Sets what cards have to be unlocked in order to be used in this encounter. + - **`AddTurnMods`:** Used in Part 3 to overclock played cards above the specified difficulty on the specified turn. + - **`AddTurn`:** Adds a turn to the turn plan. + - **`AddTurns`:** Adds turns to the turn plan. + - **`DuplicateTurns`:** Duplicates all turns currently in the turn plan by the specified amount. + - **`SyncDifficulties`:** Sets the minimum and maximum difficulties of all cards in the turn plan. +- `CardBlueprint` + - **`SetDifficulty`:** Sets the minimum and maximum difficulties at which this card can be played. + - **`SetReplacement`:** Sets the card that will replace the base card at and above the specified difficulty. +- `List` + - **`SetTurnDifficulty`:** Sets the minimum and maximum difficulties of each card in the list. + - **`DuplicateTurn`:** Duplicates the list the specified number of times. Designed to be used with `EncounterBlueprintData.AddTurns()`. \ No newline at end of file diff --git a/docs/wiki/nodes.md b/docs/wiki/nodes.md new file mode 100644 index 000000000..8b6408455 --- /dev/null +++ b/docs/wiki/nodes.md @@ -0,0 +1,95 @@ +# Adding Map Nodes + +When adding a custom node to the game map, be prepared to implement potentially complex game logic. +Every new node requires a `sequencer` class, which controls the event that happens when you enter a map node. +This includes the creation of game objects, animation of objects, manipulating the player's deck, and everything else you may want the map node to do. + +Your `sequencer` class must implement the API's `ICustomNodeSequencer` interface, otherwise the API will have difficulty executing the event correctly. +The API provides a couple template `sequencer` classes to make this easier for you: `CustomNodeSequencer` and `CustomCardChoiceNodeSequencer`. + +The former is a basic abstract class that simply implements the above interface as well as every other node-related interface in the API. +The latter class is intended for custom card choice nodes. + +**It's highly recommended that you decompile the game's node sequencer classes to get a feel of how they work.** + +Along with a `sequencer`, you will need to create an animation so the node will appear on the map. +This takes the form of an array of exactly four textures, each sized at `49x49` pixels. +Each of these textures should be similar to each other if you want to mimic the 'shakiness' of the game's nodes. + +With all these pieces, the final step is to register your custom node with the API: +```c# +Assembly asm = typeof(MyCustomSequencer).Assembly; + +NewNodeManager.New( + "MyPluginGUID", "MyCustomNode", + GenerationType.SpecialEvent, typeof(MyCustomSequencer), + new List { + TextureHelper.GetImageAsTexture("animated_node_1.png", asm), + TextureHelper.GetImageAsTexture("animated_node_2.png", asm), + TextureHelper.GetImageAsTexture("animated_node_3.png", asm), + TextureHelper.GetImageAsTexture("animated_node_4.png", asm) + } +); +``` + +`GenerationType` is a flag-style enumeration that tells the API where the node should appear. +Flag-style means that multiple values can be combined using the bitwise-or operator (`|`). +For example, if you want the node to randomly appear before a battle, but also be forced to appear directly before the boss, +you can use this combination: +```c# +GenerationType.SpecialEvent | GenerationType.PreBoss +``` + +The values of `GenerationType` are: + +- **`None`:** This node will not be autogenerated on the map, but can still be manually added (for example, if you are manually manipulating Act 3 maps). +- **`SpecialCardChoice`:** This node will appear in the pool of random events that happen right after a battle. +- **`SpecialEvent`:** This node will appear in the pool of random events that happen right before a battle. +- **`RegionStart`:** This node will be forced to appear at the start of each map, unless the node fails a prerequisite condition. +- **`PreBoss`:** This node will be forced to appear right before the boss of each map, unless the node fails a prerequisite condition +- **`PostBoss`:** This node will be forced to appear right after the boss of each map, unless the node fails a prerequisite condition + +## Conditional Nodes +Map nodes can implement logic that determines whether or not they are generated on the map. +This is done using the `SelectionCondition` class, and when registering your node you'll have the ability to give it `SelectionConditions` that control its generation logic. + +There are two condition types: prerequisite and forced generation. +The former prevents a node from generating if any condition return false, and the latter forces a node to generate if any condition returns true; + +The game comes prepackaged with several premade `SelectionConditions`, but you can also create your own. + +Base `SelectionConditions`: +- **`CardsInDeckTraits`:** Checks if any cards in your deck have the given Trait, can be used as a blacklist or whitelist. +- **`EitherOr`:** Checks if either of the given `SelectionConditions` were satisified. +- **`IsAscension`:** Checks if the player is playing Kaycee's Mod. +- **`PastRunsCompleted`:** Checks if the given integer is greater or equal to the number of previous completed runs. +- **`PreviousNodesContent`:** Checks if the list of all previous map nodes contains the given NodeType, can be used as a blacklist or whitelist. +- **`PreviousRowContent`:** Checks if the previous row of map nodes contains the given NodeType, can be used as a blacklist or whitelist. +- **`StoryEventCompleted`:** Checks if the given StoryEvent has been completed. +- **`WithinGridYRange`:** Checks if the current map node location is within the given range. + +The API also adds two custom `SelectionConditions`: +- **`ChallengeIsActive`:** Checks if the given Challenge is active, can be used as a blacklist or whitelist. +- **`NumChallengesOfTypeActive`:** Compares the given integer to the number of active challenges of the given Type based on the value of `greaterThanNumActive`. + +Here is a code sample: +```c# +Assembly asm = typeof(MyCustomSequencer).Assembly; + +NewNodeManager.New( + "MyPluginGUID", "MyCustomNode", + GenerationType.SpecialEvent, typeof(MyCustomSequencer), + new List { + TextureHelper.GetImageAsTexture("animated_node_1.png", asm), + TextureHelper.GetImageAsTexture("animated_node_2.png", asm), + TextureHelper.GetImageAsTexture("animated_node_3.png", asm), + TextureHelper.GetImageAsTexture("animated_node_4.png", asm) + }, + new List { + new ChallengeIsActive(AscensionChallenge.BaseDifficulty, exclude: true) // prevent generation if there are no BaseDifficulty challenges active. + }, + new List { + new NumChallengesOfTypeActive(AscensionChallenge.BaseDifficulty, 2, greaterThanNumActive: false) // force generation if there are 2 or more BaseDifficulty challenges active. + } +); +``` \ No newline at end of file diff --git a/docs/wiki/opponent.md b/docs/wiki/opponents.md similarity index 69% rename from docs/wiki/opponent.md rename to docs/wiki/opponents.md index d384b2aba..b1f0a7104 100644 --- a/docs/wiki/opponent.md +++ b/docs/wiki/opponents.md @@ -1,23 +1,5 @@ -## Special Sequencers -Special sequencers are essentially 'global abilities;' they listen to the same triggers that cards do and can execute code based on these triggers (such as whenever cards are played or die, at the start of each turn, etc). - -While you can inherit directly from SpecialBattleSequencer, there is a hierarchy of existing special sequencers that you may wish to inherit from depending upon your use case. You can use dnSpy to see all of them, but these are three you should be specifically aware of: - -- **SpecialBattleSequencer**: The base class for all special sequencers. Use this by default. -- **BossBattleSequencer**: Used for boss battles -- **Part1BossBattleSequencer**: Use for boss battles in Act 1 (Angler, Prospector, Trapper/Trader, and Leshy) - -Special sequencers are set directly on the NodeData instance corresponding to the map node that the player touches to start the battle. This is done using a string value corresponding to the sequencer. To set this yourself, use the SpecialSequenceManager class in the API: - -```c# -public class MyCustomBattleSequencer : Part1BossBattleSequencer -{ - public static readonly string ID = SpecialSequenceManager.Add(Plugin.PluginGuid, "MySequencer", typeof(MyCustomBattleSequencer)); -} -``` +# Opponents -## Opponents ---- In the context of this API, think of opponents as basically just bosses. There is a enumeration of Opponents called Opponent.Type that refers to the opponent. This name can be confusing in some IDEs, as they may simply show the parameter type as Type, which should not be confused with the System.Type type. Like everything else, Opponents are classes that you have to write that are responsible for handling the weird things that happen during battle. Depending upon which type of opponent you are buiding, you will need to use one of the following base classes: @@ -54,8 +36,26 @@ public override IEnumerator IntroSequence(EncounterData encounter) } ``` +## Special Sequencers +Special sequencers are essentially 'global abilities;' they listen to the same triggers that cards do and can execute code based on these triggers (such as whenever cards are played or die, at the start of each turn, etc). + +While you can inherit directly from SpecialBattleSequencer, there is a hierarchy of existing special sequencers that you may wish to inherit from depending upon your use case. You can use dnSpy to see all of them, but these are three you should be specifically aware of: + +- **SpecialBattleSequencer**: The base class for all special sequencers. Use this by default. +- **BossBattleSequencer**: Used for boss battles +- **Part1BossBattleSequencer**: Use for boss battles in Act 1 (Angler, Prospector, Trapper/Trader, and Leshy) + +Special sequencers are set directly on the NodeData instance corresponding to the map node that the player touches to start the battle. This is done using a string value corresponding to the sequencer. To set this yourself, use the SpecialSequenceManager class in the API: + +```c# +public class MyCustomBattleSequencer : Part1BossBattleSequencer +{ + public static readonly string ID = SpecialSequenceManager.Add(Plugin.PluginGuid, "MySequencer", typeof(MyCustomBattleSequencer)); +} +``` + ## AI ---- + In most cases, you will probably not need to create a custom AI. By default, the game will look at the cards that the computer is preparing to play and then use brute force to test every possible slot that the computer could queue those slots for. It will then simulate a full turn of the game for each of those positions and determine which one has the best outcome. There are very few exceptions to this rule. As an example, one exception is the Prospector boss fight, where the computer will always play the Pack Mule in slot 0 and a coyote in slot 1. It's important that these cards always get played in this position, so the game has a custom AI that detects this part of the game and overrides the default AI. @@ -88,81 +88,4 @@ public class MyCustomBattleSequencer : Part1BossBattleSequencer return data; } } -``` - -## Boss Masks ---- -When creating a custom boss opponent, you may feel the urge to change what mask Leshy adorns during the fight. -Fortunately, the API's got you covered. - -### Changing an Existing Mask -This allows you to change a mask already added to Inscyrption. Can be any Vanilla masks or one someone else has added. - -```csharp -MaskManager.Override("guid", "nameOfNewMask", LeshyAnimationController.Mask.Angler, "pathToTexture"); -``` -This example shows changing the mask the Angler uses to have a custom texture we are using. - -NOTE: This also changes the model so we can use a texture without the fuss of UV mapping the Anglers actual mask. -If you still want to use the Anglers model then use `.SetModelType(MaskManager.ModelType.Angler)` - -### Adding a Random Mask -If you want to add a new mask that will be randomly chosen when Leshy goes to put on a mask use this. -```csharp -MaskManager.AddRandom("guid", "nameOfNewMask", LeshyAnimationController.Mask.Prospector, "pathToTexture"); -``` -This example shows adding a new mask that when going to the Prospector boss fight, Leshy will choose between the default Prospector mask and this new one. - -You can add as many random masks as you want. There is no limit. - -### Adding a Custom Mask - -```csharp -MaskManager.Add("guid", "nameOfNewMask", "pathToTexture"); -``` - -### Adding a Custom Model - -```csharp -ResourceLookup resourceLookup = new ResourceLookup(); -resourceLookup.FromAssetBundle("pathToAssetBundle", "prefabNameInsideBundle"); -MaskManager.ModelType modelType = MaskManager.RegisterPrefab("guid", "nameOfModel", resourceLookup); - -var mask = MaskManager.Add("guid", "nameOfMask"); -mask.SetModelType(modelType); -``` - -### Putting on a Mask -This will tell Leshy to push a mask on his face. - -Useful for when you have your own boss sequence and you want to tell Leshy to put on your new mask! - -```csharp -LeshyAnimationController.Instance.PutOnMask(LeshyAnimationController.Mask.Woodcarver, false); -``` - -### Adding Custom Mask Behaviour - -```csharp -public class Plugin : BaseUnityPlugin -{ - private void Awake() - { - MyCustomMask.Setup(); - } -} -``` - -```csharp -public class MyCustomMask : MaskBehaviour -{ - public static LeshyAnimationController.Mask ID; - - public static void Setup() - { - var mask = MaskManager.Add("guid", "nameOfNewMask", "pathToTexture"); - mask.SetMaskBehaviour(typeof(MyCustomMask)); - ID = mask.ID; - } -} ``` \ No newline at end of file diff --git a/docs/wiki/other_features.md b/docs/wiki/other_features.md index 17d0ac5f0..20ebd346b 100644 --- a/docs/wiki/other_features.md +++ b/docs/wiki/other_features.md @@ -1,4 +1,4 @@ -## Other Features +# Other Features Listed here are various miscellaneous features that the API adds that aren't covered in other articles, or aren't covered in much detail. ## Negative and Self-Damage diff --git a/docs/wiki/pelts.md b/docs/wiki/pelts.md index c75d3f73b..6bd388385 100644 --- a/docs/wiki/pelts.md +++ b/docs/wiki/pelts.md @@ -1,12 +1,12 @@ -## Custom Pelts ---- +# Custom Pelts + The pelts bought and sold by the Trapper and Tradder are comprised of two components: the CardInfo and the PeltData. The CardInfo represents the actual card that you can obtain and sell, and is created using the CardManager the same way as any regular card. The PeltData on the other hand is created using the API's PeltManager. The PeltData determines how the CardInfo is handled by the Trapper and Trader. This includes how much it costs to buy, how much the price increases over a run,and what and how many cards the Trader will offer for the pelt. -### Adding a Custom Pelt +## Adding a Custom Pelt The first step is making the card. ```csharp CardInfo bonePeltInfo = CardManager.New(PluginGuid, "Bone Pelt", "Bone Pelt", 0, 2); @@ -32,8 +32,8 @@ PeltManager.CustomPeltData bonePelt = PeltManager.New(yourPluginGuid, bonePeltIn This pelt will now cost 3 Teeth to buy from the Trapper, and the Trader will offer you 8 cards to choose from for it; the offered cards will have 0 extra abilities added onto them as well. -### Pelt Extensions ---- +## Pelt Extensions + The following extensions are provided for further customisation: - **SetPluginGuid:** Sets the Guid of the plugin that's adding the pelt. Useful if you aren't using PeltManager.New() to create your pelt. - **SetBuyPrice:** Sets the base buy price of the pelt, meaning how much it costs initially before modifiers are added. Optionally sets the max buy price for the pelt as well (default price is 20). diff --git a/docs/wiki/rulebook.md b/docs/wiki/rulebook.md index 5a9a3eb97..0d3cdb3f5 100644 --- a/docs/wiki/rulebook.md +++ b/docs/wiki/rulebook.md @@ -1,4 +1,4 @@ -## The Rulebook +# The Rulebook The Rulebook is a vital tool for the player while playing outside of Act 2. Every ability, stat icon, boon, and item that can appear in the current Act will have an entry in the book, providing information on what each one does. @@ -15,4 +15,4 @@ Maybe you want an ability to always appear at the beginning of the Rulebook for The former case can be easily handled with a simple patch to RuleBookInfo.ConstructPageData, but the latter can get fairly complicated. In either case, you can use the API's RuleBookManager to make this process simpler. -\* *Items and Boons can be made to appear in multiple Acts or outside Act 1 by modifying their associated Full(...)Info.* \ No newline at end of file +> *Items and Boons can be made to appear in multiple Acts or outside Act 1 by modifying their associated Full(...)Info.* \ No newline at end of file diff --git a/docs/wiki/rulebook_sections.md b/docs/wiki/rulebook_sections.md index f2ad9a694..2c9dcc9b2 100644 --- a/docs/wiki/rulebook_sections.md +++ b/docs/wiki/rulebook_sections.md @@ -1,3 +1,5 @@ +# Rulebook Sections + ## Adding Custom Sections In some rare cases, you may want to add a whole new section of pages to the rulebook. This can get pretty technical, so an example has been provided below on how best to set up your new rulebook section. diff --git a/docs/wiki/shield.md b/docs/wiki/shield.md index 440b1e2dd..81b98a86c 100644 --- a/docs/wiki/shield.md +++ b/docs/wiki/shield.md @@ -1,5 +1,5 @@ -## DamageShieldBehaviour ---- +# DamageShieldBehaviour + Ever wanted to create your own version of the Armoured sigil, but were frustrated by the game's simplistic boolean logic for shields? Worry not! Using the API, you can now easily create your own! Simply create a class that inherits from DamageShieldBehaviour (or ActivatedDamageShieldBehaviour) and you're good to go. diff --git a/docs/wiki/slots.md b/docs/wiki/slots.md index ad2fb0194..0e20a7cac 100644 --- a/docs/wiki/slots.md +++ b/docs/wiki/slots.md @@ -1,18 +1,18 @@ -## Slot Modifications ---- +# Slot Modifications + The API now supports adding abilities and behaviors to card slots! These "slot modifications" are implemented very similarly to how you would implement sigils; you just need to code your modification logic as a subclass of `SlotModificationBehaviour` and make some custom artwork for what the new slot should look like. -### Creating Slot Textures and Sprites +## Creating Slot Textures and Sprites -Slot textures in 3D game zones are 154x226 pixels. You can either create a single slot texture for all zones, or create a separate texture for Leshy, P03, Grimora, and Magnificus. +Slot textures in 3D game zones are `154x226` pixels. You can either create a single slot texture for all zones, or create a separate texture for Leshy, P03, Grimora, and Magnificus. -Slot textures in 2D game zones are 44x58 pixels. There are five different themes for 2D battles (Nature, Tech, Undead, Wizard, and Finale), and slots change their appearance when you hover over them. Additionally, you may wish to have a different texture for the opponent than for the player (this is most likely to happen in the Nature theme as the claw icons faces down for the opponent and up for the player). In order to accomodate all of these different combinations, you are given a number of options when supplying textures to the `SlotModificationManager`: +Slot textures in 2D game zones are `44x58` pixels. There are five different themes for 2D battles (`Nature`, `Tech`, `Undead`, `Wizard`, and `Finale`), and slots change their appearance when you hover over them. Additionally, you may wish to have a different texture for the opponent than for the player (this is most likely to happen in the Nature theme as the claw icons faces down for the opponent and up for the player). In order to accomodate all of these different combinations, you are given a number of options when supplying textures to the `SlotModificationManager`: -- If you provide a 44x58 texture, the manager will create 10 variations of it automatically, recoloring it to fit the color (standard and highlighted/mouse-over) of each theme. All black and transparent pixels will be left as-is; all remaining pixels will be replaced with the appropriate color for the theme. -- If you provide a 220x116 texture, the manager will slice this into 10 sprites - two rows, five columns. The first row will be the standard slot, and the second row will be the slot when hovering. In order, the columns will be Nature, Undead, Tech, Wizard, Finale. -- If you provide a 220x232 texture, it behaves the same as above, except rows 3 and 4 are used for the opponent slots. +- If you provide a `44x58` texture, the manager will create 10 variations of it automatically, recoloring it to fit the color (standard and highlighted/mouse-over) of each theme. All black and transparent pixels will be left as-is; all remaining pixels will be replaced with the appropriate color for the theme. +- If you provide a `220x116` texture, the manager will slice this into 10 sprites - two rows, five columns. The first row will be the standard slot, and the second row will be the slot when hovering. In order, the columns will be `Nature`, `Undead`, `Tech`, `Wizard`, `Finale`. +- If you provide a `220x232` texture, it behaves the same as above, except rows 3 and 4 are used for the opponent slots. -### Creating a Slot Modification Behaviour +## Creating a Slot Modification Behaviour You need to create a subclass of `SlotModificationBehaviour` to implement your slot's logic. You can also add on API interface triggers as part of this. @@ -69,7 +69,7 @@ public class AwesomeLookingSlot : SlotModificationBehaviour } ``` -### Registering A Slot Modification +## Registering a Slot Modification The pattern is very similar to creating a new sigil; you need to call the `SlotModificationManager` to register your slot mod and then store the result you get back: @@ -83,7 +83,7 @@ public static readonly SlotModificationManager.ModificationType SharpQuillsSlot ) ``` -### Activating A Slot Modification +## Activating a Slot Modification You'll almost always end up creating a slot modification as part of another sigil. Here, we have an example custom sigil that activates the slot when the card dies. You do this by using the extension method `SetSlotModification`. diff --git a/docs/wiki/sniper.md b/docs/wiki/sniper.md index fb028cf5d..14d9bbed9 100644 --- a/docs/wiki/sniper.md +++ b/docs/wiki/sniper.md @@ -1,21 +1,21 @@ -## Custom Sniper Logic ---- +# Custom Sniper Logic + Though not technically part of the API proper, the community patches still offer a number of useful options for modders to take advantage of. -InscryptionCommunityPatch.Card.SniperFix, as its name suggests, fixes the Sniper ability when used in Act 1. It does more than just that, however; it also expands the Sniper ability's logic into a number of overridable methods, allowing for further customisation to how Sniper functions in all parts of the game. +`InscryptionCommunityPatch.Card.SniperFix`, as its name suggests, fixes the Sniper ability when used in Act 1. It does more than just that, however; it also expands the Sniper ability's logic into a number of overridable methods, allowing for further customisation to how Sniper functions in all parts of the game. To modify these methods, you will need to patch them using Harmony. These methods are: -- DoSniperLogic() - controls whether to use player or opponent sniper logic -- DoAttackTargetSlotsLogic() - controls attack logic for each target slot -- GetValidTargets() - returns the list of card slot the player and opponent can target -- PlayerTargetSelectedCallback() - called when the player selects a valid target -- PlayerSlotCursorEnterCallback() - called when the player's cursor enters a slot -- OpponentSelectTarget() - returns a card slot for the opponent to target and attack +- `DoSniperLogic()` - controls whether to use player or opponent sniper logic +- `DoAttackTargetSlotsLogic()` - controls attack logic for each target slot +- `GetValidTargets()` - returns the list of card slot the player and opponent can target +- `PlayerTargetSelectedCallback()` - called when the player selects a valid target +- `PlayerSlotCursorEnterCallback()` - called when the player's cursor enters a slot +- `OpponentSelectTarget()` - returns a card slot for the opponent to target and attack For example, if you wanted to allow cards with the Sniper ability to target any card slot, including slots on the same side of the board, you would do: -``` +```c# [HarmonyPostfix, HarmonyPatch(typeof(SniperFix), nameof(SniperFix.GetValidTargets))] private static void TargetAllSlots(ref List __result, bool playerIsAttacker, CardSlot attackingSlot) { diff --git a/docs/wiki/sound.md b/docs/wiki/sound.md index 32fe3da8b..f528ad1bb 100644 --- a/docs/wiki/sound.md +++ b/docs/wiki/sound.md @@ -1,5 +1,7 @@ +# Sound + ## Adding Music Tracks to the Gramophone ---- + This API supports adding new tracks to the Gramophone in Leshy's Cabin. (A user must have the Hex disc unlocked in order to be able to listen to the new tracks.) diff --git a/docs/wiki/talking_cards.md b/docs/wiki/talking_cards.md index 11a9b3a4e..f79fd0e4e 100644 --- a/docs/wiki/talking_cards.md +++ b/docs/wiki/talking_cards.md @@ -1,22 +1,22 @@ -## Talking Cards ---- +# Talking Cards + This API supports creating new talking cards from scratch, without the need to load up your own Unity prefabs or anything of the sort! -All you have to do is create a class that implements the **ITalkingCard** interface, which contains the following fields: +All you have to do is create a class that implements the `ITalkingCard` interface, which contains the following fields: | Field | Type | Description | |-----------------|-------------------------|-----------------------------------------------------------------| -| CardName | string | The name of an existing card. | -| Emotions | List\ | Your talking card's emotions. | -| FaceInfo | FaceInfo | A bit of info about your talking card: blink rate and voice. | -| DialogueAbility | SpecialTriggeredAbility | The special ability that controls your talking card's dialogue. | +| `CardName` | `string` | The name of an existing card. | +| `Emotions` | `List` | Your talking card's emotions. | +| `FaceInfo` | `FaceInfo` | A bit of info about your talking card: blink rate and voice. | +| `DialogueAbility` | `SpecialTriggeredAbility` | The special ability that controls your talking card's dialogue. | And after that, all you need to do is register your talking card with the `TalkingCardManager.New()` method as such: ```csharp TalkingCardManager.New(); ``` -Additionally, as you can see from the last item in the table above, you're gonna need to create a new SpecialTriggeredAbility that controls your talking card's dialogue. +Additionally, as you can see from the last item in the table above, you're gonna need to create a new `SpecialTriggeredAbility` that controls your talking card's dialogue. Don't worry, I'll explain exactly what you need to do! @@ -24,12 +24,12 @@ Fortunately for you, this API already supports creating new special abilities. A | Act | Class To Inherit From | |-------|-----------------------| -| Act 1 | PaperTalkingCard | -| Act 3 | DiskTalkingCard | +| Act 1 | `PaperTalkingCard` | +| Act 3 | `DiskTalkingCard` | -**Additionally**, to make the task of creating Act 1 talking cards even easier for you, I've defined an abstract class that inherits from **PaperTalkingCard**, includes the **ITalkingCard** interface and adds a few small tweaks behind the scenes! It's called **CustomPaperTalkingCard**. +**Additionally**, to make the task of creating Act 1 talking cards even easier for you, I've defined an abstract class that inherits from `PaperTalkingCard`, includes the `ITalkingCard` interface and adds a few small tweaks behind the scenes! It's called `CustomPaperTalkingCard`. -All you have to do is create a class that inherits from **CustomPaperTalkingCard** and implement its abstract fields as such: +All you have to do is create a class that inherits from `CustomPaperTalkingCard` and implement its abstract fields as such: ```csharp public class ExampleTalkingCard : CustomPaperTalkingCard @@ -72,209 +72,52 @@ And, after that, all you need to do is register your new talking card with the ` TalkingCardManager.New(); ``` -**Note**: **CustomPaperTalkingCard** can only be used for Act 1 talking cards. If you want to make an Act 3 talking card, you're gonna have to inherit from DiskTalkingCard directly! +**Note**: `CustomPaperTalkingCard` can only be used for Act 1 talking cards. If you want to make an Act 3 talking card, you're gonna have to inherit from `DiskTalkingCard` directly! Below I'm going to explain a few important things about talking cards in-depth! -### EmotionData -The EmotionData class is a container for the sprites for one of your character's emotions. It has a constructor that takes Unity Sprites as parameters, and another constructor that takes the path to your image as a string for each image. +## Emotion Data +The `EmotionData` class is a container for the sprites for one of your character's emotions. It has a constructor that takes Unity Sprites as parameters, and another constructor that takes the path to your image as a string for each image. The constructors take the following parameters: | Parameter | Description | |-----------|-------------------------------------------------------------------------| -| emotion | The chosen emotion. | -| face | A sprite for your character's face. | -| eyes | A pair of sprites for your character's eyes: open and closed. | -| mouth | A pair of sprites for your character's mouth: open and closed. | -| emission | A pair of sprites for your character's eyes' emission: open and closed. | +| `emotion` | The chosen emotion. | +| `face` | A sprite for your character's face. | +| `eyes` | A pair of sprites for your character's eyes: open and closed. | +| `mouth` | A pair of sprites for your character's mouth: open and closed. | +| `emission` | A pair of sprites for your character's eyes' emission: open and closed. | If you ever need to use an empty portrait texture, you can use `TalkingCardManager.EmptyPortrait`! The string constructor also contains shorthand for an empty texture, if you need it: Just add an "\_" as your string for that given parameter. -A guide on how to **use emotions** in your card's dialogue can be found [in this section below](#using-emotions-in-dialogue). +A guide on how to **use emotions** in your card's dialogue can be found [in this section of the Dialouge Events Page](dialouge_events.md#using-emotions-in-dialogue). -### FaceInfo -The FaceInfo class contains a bit of info about your talking card: namely, blink rate, voice pitch, and the sound used for your character's voice in general. +## Face Info +The `FaceInfo` class contains a bit of info about your talking card: namely, blink rate, voice pitch, and the sound used for your character's voice in general. The constructor takes the following parameters: | Parameter | Type | Description | |-----------------|--------|-------------------------------------------------------------| -| blinkRate | float | How often your character blinks. | -| voiceId | string | Your character's "voice". Will explain more below. | -| voiceSoundPitch | float | Your character's voice's pitch. | -| customVoice | string | A custom voice for your character. Will be explained below. | +| `blinkRate` | float | How often your character blinks. | +| `voiceId` | string | Your character's "voice". Will explain more below. | +| `voiceSoundPitch` | float | Your character's voice's pitch. | +| `customVoice` | string | A custom voice for your character. Will be explained below. | -"voiceId" can only be one of these three strings: -1. female1_voice -2. cat_voice -3. kobold_voice +`voiceId` can only be one of these three strings: +1. `female1_voice` +2. `cat_voice` +3. `kobold_voice` Most talking cards in the game use the first and simply change the pitch. -### Custom Voices -You can add a custom voice to your character instead of using one of the default voices. For that, all you need to is pass the path to your audio file as the "customVoice" parameter. +## Custom Voices +You can add a custom voice to your character instead of using one of the default voices. For that, all you need to is pass the path to your audio file as the `customVoice` parameter. The supported audio formats are MP3, WAV, OGG and AIFF! Please use a very short audio file for your voice. Typically, you want only a very short 'vowel' sound for this, since it's going to be played in rapid repetition. -If you pass anything as "customVoice", then the contents of the "voiceId" parameter will not matter. - -## Dialogue Events ---- -After looking at the example above, you might be wondering *"What's all of that DialogueId stuff about? How do I make my own dialogue events?"*. - -I'm gonna explain everything to you in detail now! - -### Dialogue Triggers -Talking cards can respond to a variety of game events. If you want your card to respond to a given event, you can override that property and return the ID of your new dialogue event. - -Some properties are abstract and *must* be implemented: namely, `OnDrawnDialogueId`, `OnPlayFromHandDialogueId`, `OnAttackedDialogueId`, `OnBecomeSelectablePositiveDialogueId` and `OnBecomeSelectableNegativeDialogueId`. - -And here's a full list of triggers you can override, and a small explanation of each. - -**Note**: All of these names end in "DialogueId", so I've omitted that last part of the name to be concise. - -| Trigger | Description | -|----------------------------|----------------------------------------------------------------| -| OnDrawn | Plays when your card is drawn. | -| OnPlayFromHand | Plays when your card is played. | -| OnAttacked | Plays when your card is attacked. | -| OnBecomeSelectablePositive | Plays when your card becomes selectable for a positive effect. | -| OnBecomeSelectableNegative | Plays when your card becomes selectable for a negative effect. | -| OnSacrificed | Plays when your card is sacrificed. | -| OnSelectedForDeckTrial | Plays when your card is selected in the deck trial node. | -| OnSelectedForCardMerge | Plays before your card receives the sigil in the sigil node. | -| OnSelectedForCardRemove | Plays when your card is selected for removal. | - -Additionally, the `OnDrawnSpecialOpponentDialogueIds` dictionary lets you add special dialogue when your card is drawn in a specific boss battle, like this: - -```csharp -public override Dictionary OnDrawnSpecialOpponentDialogueIds => new Dictionary() -{ - { Opponent.Type.ProspectorBoss, "Example_TalkAboutProspector" } -}; -``` - -### Creating a Dialogue Event -You can create your own dialogue events with this API's `DialogueManager.GenerateEvent()` method, like this: - -```csharp -DialogueManager.GenerateEvent( - pluginGUID: Plugin.PluginGuid, - name: "Example_OnPlayFromHand", - mainLines: new List() { "This is a main line." }, - repeatLines: new List>() - { - new List() { "This is a repeat line!" }, - new List() { "This is another repeat line!" } - } -); -``` - -A brief explanation of each parameter: - -| Field | Description | -|-------------|---------------------------------------------------------------------------------| -| pluginGUID | Your mod's GUID. | -| name | The name for your dialogue event; this is what you'll use to refer to it! | -| mainLines | A set of lines that plays in the very first time this event runs. | -| repeatLines | Multiple sets of lines that are played after the first time this event has run. | - -### Dialogue Codes -A really neat feature of Inscryption's dialogue events are dialogue codes. They add a lot of life to dialogue! - -The dialogue codes most relevant to talking cards will be explained below. All of these work with talking cards. - -### Wait (\[w:]) -This is by far the dialogue code you'll wanna use the most. It's also the one the game itself uses the most in all of its dialogue. - -The "\[w:x]" dialogue code adds a pause of x seconds before the rest of a sentence plays. - -You can use it like this: -``` -"Hello.[w:1] How are you?" -``` -In this example, after saying "Hello.", the character waits 1 second before saying "How are you?". - -The number of seconds does not have to be an integer. Using "\[w:0.2]" to wait only 0.2 seconds is valid, for example, and used often throughout the base game's dialogue. - -This being said, I'd advise you not to go below \[w:0.1], as I don't know how small the number can go before issues arise. (And there's no point in going below that, anyhow.) - -### Color (\[c:]) -The \[c:] dialogue code changes the color of a portion of your text. - -You can use it like this: -``` -"[c:R]This text is red.[c:] This text is not." -``` -In this example, the part after \[c:R] is colored in the color that matches the code 'R', which is the color red, and the part after \[c:] has the default text color. You can think of this as "switching on" the colorful text mode and then switching it off. - -*"But how do I know the codes for each color?"* -Fear not! Here's a comprehensive table of all available colors and their respective codes: - -| Code | Color | -|------|-------------------| -| B | Blue | -| bB | Bright Blue | -| bG | Bright Gold | -| blGr | Bright Lime Green | -| bR | Bright Red | -| brnO | Brown Orange | -| dB | Dark Blue | -| dlGr | Dark Lime Green | -| dSG | Dark Seafoam | -| bSG | Glow Seafoam | -| G | Gold | -| gray | Gray | -| lGr | Lime Green | -| O | Orange | -| R | Red | - -(For the record: These are the colors the game has available, built-in. I did not choose them. Yes, it's a very odd selection of colors.) - -#### Custom Colors -I have added a way to use custom colors with dialogue codes. In place of one of the color codes in the table above, you can instead use a [hex color code](https://htmlcolorcodes.com/color-picker/), and this mod will parse the code into an usable Color for the text. - -Here's an example: -``` -"You must be... [w:0.4][c:#7f35e6]confused[c:][w:1].", -``` -In this example, the word "confused" is colored in the color #7f35e6. Which, if you don't wanna look it up, it's [this color!](https://g.co/kgs/JPHV5v) - -Please note that for compatibility reasons, your hex color code **should include the '#'**. - -### Making Leshy Talk -The \[leshy:x] dialogue code makes Leshy say x. This color code is very useful for making Leshy and your card talk a bit between each other! - -You can use it like this: - -``` -"We're all doomed.[leshy:Quiet now.][w:2]", -``` - -In this example, the character says "We're all doomed." and then Leshy says "Quiet now." right after. The text remains on the screen for 2 seconds. - -There are a few things to note from that example: - -1. You don't need to put quotation marks around the line Leshy is going to say. -2. The "Wait" dialogue code is still usable with Leshy's lines. - -### Using Emotions in Dialogue -You can change your character's emotion in their dialogue lines with the dialogue code `[e:x]`, where 'x' is the name of an emotion. You can look at the table above for the names of all the available emotions. - -This mod adds patches to make the emotion names not case-sensitive, which means the following lines are all equally valid: - -``` -"[e:Anger]I'm angry." -"[e:anger]I'm angry." -"[e:AnGeR]I'm angry and my keyboard is acting up." -``` - -If you prefer, you can use the numeric value associated with an emotion instead of its name! This is perfectly valid, for example: - -``` -"[e:2]I'm angry." -``` +If you pass anything as `customVoice`, then the contents of the `voiceId` parameter will not matter. \ No newline at end of file diff --git a/docs/wiki/toc.yml b/docs/wiki/toc.yml index 523a45e33..60b24fc14 100644 --- a/docs/wiki/toc.yml +++ b/docs/wiki/toc.yml @@ -2,7 +2,8 @@ items: - name: Home href: index.md - name: Getting Started - href: getting_started.md + href: getting_started/toc.yml + homepage: getting_started/index.md - name: Cards href: card_management.md items: @@ -10,6 +11,9 @@ items: href: custom_costs.md - name: Talking Cards href: talking_cards.md + items: + - name: Dialouge Events + href: dialouge_events.md - name: Custom Pelts href: pelts.md - name: Abilities @@ -17,25 +21,32 @@ items: items: - name: Custom Triggers href: triggers.md + - name: Additional Functionality for Activated Abilities + href: activated_abilities.md - name: Custom Sniper Logic href: sniper.md - name: DamageShieldBehaviour href: shield.md - name: Slot Modifications href: slots.md - - name: Trigger Order + - name: Triggers and Order of Operations href: triggers_priority.md -- name: Custom Properties +- name: Extended Properties href: custom_properties.md - name: Ascension (Kaycee's Mod) href: ascension.md - name: Maps and Encounters href: map.md + items: + - name: Adding Map Nodes + href: nodes.md - name: Opponents - href: opponent.md + href: opponents.md +- name: Boss Masks + href: boss_masks.md - name: Totems href: totems.md -- name: Items +- name: Custom Items href: items.md - name: The Rulebook href: rulebook.md @@ -48,7 +59,7 @@ items: href: asset_bundle.md - name: Sound href: sound.md -- name: Localisation +- name: Localization href: localisation.md - name: Other Features href: other_features.md \ No newline at end of file diff --git a/docs/wiki/totems.md b/docs/wiki/totems.md index 366112cc2..3997bbf75 100644 --- a/docs/wiki/totems.md +++ b/docs/wiki/totems.md @@ -1,5 +1,5 @@ -## Custom Totem Tops ---- +# Custom Totem Tops + When creating custom Tribes, mostly likely you'll want it to be usable with Totems as well. There is a default model for custom Totem Tops, but if you have a custom-made model you want to use, the API's got you covered. @@ -16,7 +16,7 @@ if (AssetBundleHelper.TryGet("pathToAssetBundle", "nameOfPrefabInAssetBundle", o } ``` -## "I don't have an icon to show on my totem top!" +## "I Don't Have an Icon to Show on My Totem Top!" You will need a new class for your totem top so it doesn't look for an icon to populate from a tribe. ```csharp diff --git a/docs/wiki/triggers.md b/docs/wiki/triggers.md index 03f302b22..0edfc6b45 100644 --- a/docs/wiki/triggers.md +++ b/docs/wiki/triggers.md @@ -1,39 +1,39 @@ -## Custom Triggers ---- +# Custom Triggers + To give modders finer control over when abilities activate, the API adds a large number of custom triggers that you can add to your abilities or other trigger receivers via interfaces. It also adds a new class: `ExtendedAbilityBehaviour`, which has several of these interfaces already implemented. For comprehensive information on all custom triggers added by the API, refer to the documentation. If you want to understand the order all these triggers are called, look at the article -### Passive Stat Buffs +## Passive Stat Buffs Stat icons are a unique type of ability that modify a card's attack or health. Ants are the quintessential example of stat icons in use, and with the API you can add your very own. -To do this, implement the IPassiveAttackBuff or IPassiveHealthBuff and implement the required methods. `GetPassiveAttackBuff(PlayableCard target)` or `GetPassiveAttackBuff(PlayableCard target)` are the methods you will use to calculate attack and health buffs respectively. +To do this, implement the `IPassiveAttackBuff` or `IPassiveHealthBuff` and implement the required methods. `GetPassiveAttackBuff(PlayableCard target)` or `GetPassiveAttackBuff(PlayableCard target)` are the methods you will use to calculate attack and health buffs respectively. In battle, the game will iterate across all cards on the board and check whether they should receive the buffs; this is what `target` refers to: the current card being checked, and NOT just the card with the custom sigil. You will need to write the logic for determining what cards should get the buff, as well as what buff they should receive. For example, if you want the buff to only be given to the card with the custom sigil, you will need to check that `target` equals the base card. -Note: you need to be very careful about how complicated the logic is in GetPassiveAttackBuffs and GetPassiveHealthBuffs. +Note: you need to be very careful about how complicated the logic is in `GetPassiveAttackBuffs` and `GetPassiveHealthBuffs`. These methods will be called *every frame* for *every instance of the ability!!* If you're not careful, you could bog the game down substantially! -### TriggerWhenFaceDown +## `TriggerWhenFaceDown` The API allows you to add custom properties to an ability, using the same methods as for adding custom properties to cards. -The API also allows you to control whether the ability's triggers will activate when the card is facedown. -You will need to override TriggerWhenFaceDown to return true. +The API also allows you to control whether the ability's triggers will activate when the card is face down. +You will need to override `TriggerWhenFaceDown` to return true. -There are also 2 other bools you can override for more control over what triggers should activate: ShouldTriggerWhenFaceDown, which controls whether vanilla triggers will activate; and ShouldTriggerCustomWhenFaceDown, which control whether custom triggers will activate. +There are also 2 other bools you can override for more control over what triggers should activate: `ShouldTriggerWhenFaceDown`, which controls whether vanilla triggers will activate; and `ShouldTriggerCustomWhenFaceDown`, which control whether custom triggers will activate. -### Modifying What Card Slots to Attack -To do this, you need to override RespondsToGetOpposingSlots to return true (like all RespondsToXXX overrides, you can make this conditional), and then override GetOpposingSlots to return the list of card slots that your ability wants the card to attack. -If you want to override the default slot (the one directly across from the card) instead of adding an additional card slot, you will need to override RemoveDefaultAttackSlot to return true. +## Modifying What Card Slots to Attack +To do this, you need to override `RespondsToGetOpposingSlots` to return true (like all `RespondsToXXX` overrides, you can make this conditional), and then override `GetOpposingSlots` to return the list of card slots that your ability wants the card to attack. +If you want to override the default slot (the one directly across from the card) instead of adding an additional card slot, you will need to override `RemoveDefaultAttackSlot` to return true. -### Modify What Card Slots Attack +## Modify What Card Slots Attack Don't let the similar names confuse you, this is in fact a different section from the above one. -Using the IGetAttackingSlots interface, you can modify what card slots will attack each turn. +Using the `IGetAttackingSlots` interface, you can modify what card slots will attack each turn. For example, if you wanted to make a sigil that prevents a card from attacking at all: ```csharp @@ -83,8 +83,8 @@ public List GetAttackingSlots(bool playerIsAttacker, List or ``` -### Modify Damage Taken -Using IModifyDamageTaken, you can increase or reduce the damage cards take when they're attacked. +## Modify Damage Taken +Using `IModifyDamageTaken`, you can increase or reduce the damage cards take when they're attacked. Damage cannot go below 0; if it is, the API sets it to 0 after all calculations are done. ```csharp @@ -110,120 +110,4 @@ public class ReduceDamageByOne : AbilityBehaviour, IModifyDamageTaken public int TriggerPriority(PlayableCard target, int damage, PlayableCard attacker) => 0; } -``` - -## Additional Functionality for Activated Abilities ---- -The API adds a new class `ExtendedActivatedAbilityBehaviour` that adds additional functionality for use when making activated abilities. - -This new class changes how activated abilities are made a bit. -As an example, if you were inheriting from the vanilla ActivatedAbilityBehaviour, you would override BonesCost to set the... Bones cost. -ExtendedActivatedAbilityBehaviour moves that functionality to the virtual int StartingBonesCost, and BonesCost is now used to keep track of the total cost, modifiders included. - -Put simply, to set the starting cost(s), you override StartingBonesCost, StartingEnergyCost, or StartingHealthCost. - -There is also a new override IEnumerator `PostActivate()` that triggers after the main body of code. - -### Blood Cost -This behaves exactly like the Blood cost for playing cards, where you have to sacrifice other cards on your side of the board in order to trigger an effect. - -The card info and card slot of sacrificed cards will be stored in the dictionary `currentSacrificedCardInfos`, with the CardInfo as the Key and the CardSlot as the Value. -Use this if you want to manipulate sacrificed cards once they're gone, but do note that the dictionary is cleared once the ability's effect has finished. - -```c# -public Dictionary currentSacrificedCardInfos = new(); - -public override IEnumerator Activate() -{ - // Create new copies of the sacrificed cards in their original board slots - foreach (KeyValuePair valuePair in currentSacrificedCardInfos) - { - yield return Singleton.Instance.CreateCardInSlot(valuePair.Value, valuePair.Key); - } -} -``` - -### Health Cost -This is easy enough to understand, it's a way of making an activated ability cost Health to use. -If the cost is equal to the card's current Health, then it will die. - -You can set this by overriding StartingHealthCost. - -### Dynamic Activation Costs -Using ExtendedActivatedAbilityBehaviour, you can change the cost of an activated ability during battle. - -By overriding OnActivateBonesCostMod, OnActivateEnergyCostMod, OnActivateBloodCostMod, or OnActivateHealthCostMod, you can make the ability's activation cost increase after it has been activated. -```c# -public class ActivateRepulsive : ExtendedActivatedAbilityBehaviour -{ - public static Ability abiliy; - public override Ability Ability => ability; - - public override int StartingBonesCost => 2; - public override int OnActivateBonesCostMod => 1; - - public override IEnumerator Activate() - { - yield return this.Effect(); - } -} -``` -You can keep changing these modifier fields as well, if you want the cost to increase exponentially. - -```c# -public override IEnumerator PostActivate(); -{ - OnActivateBonesCostMod += 1; -} -``` -You have basically no limits on how or when you can change the activation cost. - -```c# -public override IEnumerator OnUpkeep(bool playerUpkeep) -{ - bonesCostMod -= 1; -} -``` -This will reduce the Bones activation cost by 1 on upkeep. - -Note that `bonesCostMod` was used here instead of `OnActivateBonesCostMod`; The OnActivate... fields are used for changing the cost every activation, while the ...CostMod fields are used for everything else. -Importantly, the ...CostMod fields keep track of the current cost modifier. - -```c# -bonesCostMod = 0; -``` -This resets the current Bones cost modifier. - -An additional note to make is that you're not limited to only modifying a single cost; you can increase any cost you want, even those that aren't initially required for activation. - -#### Keeping Track of It All -With the ability to modify a card's activation cost, the question of how to keep track of the new costs comes up. -While it's entirely possible you have an incredible memory and can just hoof it from there, the API provides a simpler way for you to keep track of it all by updating the Rulebook description of your ability. - -When right-clicking the ability icon of a card, the API will grab the current activation costs and display them. -This is unique to each card, so don't worry about keeping track of multiple activation costs. - -To tell the API what part of the Rulebook description should be modified, you must use `[sigilcost:X]` where X is the initial activation cost. -```c# -string rulebookDescription = "Pay [sigilcost:1 Bone, 1 Energy] to do a thing, then increase its activation cost by 1 Energy." - -AbilityManager.New(pluginGuid, rulebookName, rulebookDescription, typeof(T), "artpath.png"); -``` - -#### Triggering OnResolveOnBoard -In Act 2, upon playing a card with an activated ability you will trigger a tutorial explaining how they work. -In order to ensure this code runs, you are prevented from overriding OnResolveOnBoard, both in the vanilla behaviour and in this extended version. - -Worry not however, for there is a workaround: the new virtual methods RespondsToPostResolveOnBoard() and OnPostResolveOnBoard() can be overridden instead to the same effect. - -```c# -public override IEnumerator RespondsToPostResolveOnBoard() -{ - return true; -} - -public override IEnumerator OnPostResolveOnBoard() -{ - // put your code here -} ``` \ No newline at end of file diff --git a/docs/wiki/triggers_priority.md b/docs/wiki/triggers_priority.md index 5ab2152cf..93ee3a2d5 100644 --- a/docs/wiki/triggers_priority.md +++ b/docs/wiki/triggers_priority.md @@ -1,10 +1,10 @@ -## Triggers and Order of Operations +# Triggers and Order of Operations This article is for modders looking for specific information on the order triggers are called in various contexts. The information presented here is fairly technical and dry, and assumes you have an understanding of how Inscryption's code works. Triggers are listed in the order they are called, with the first entry being the first trigger called and the last entry being the last trigger called. -Custom triggers start with the letter 'I' and are implemented via interfaces, and the rest are vanilla triggers. +Custom triggers start with the letter `I` and are implemented via interfaces, and the rest are vanilla triggers. ## Card Damage Handled by `PlayableCard.TakeDamage`, `ShieldManager.TriggerBreakShield`, and `ShieldManager.BreakShield`. @@ -13,47 +13,47 @@ Cards with shields only call the first four triggers listed. |Trigger|Additional information| |:-|:-| -|IModifyDamageTaken|Sets the damage amount to the returned value| -|IPreTakeDamage|Called before shields are checked| -|IShieldPreventedDamage|Only called when a card has a shield| -|IShieldPreventedDamageInHand|Only called when a card has a shield

Called on cards in the player's hand| -|OnTakeDamage|Called for cards without shields| -|OtherCardDealtDamage|Called after `PlayableCard.Die`| -|IOnOtherCardDealtDamageInHand|Called on card's in the player's hand| +|`IModifyDamageTaken`|Sets the damage amount to the returned value| +|`IPreTakeDamage`|Called before shields are checked| +|`IShieldPreventedDamage`|Only called when a card has a shield| +|`IShieldPreventedDamageInHand`|Only called when a card has a shield

Called on cards in the player's hand| +|`OnTakeDamage`|Called for cards without shields| +|`OtherCardDealtDamage`|Called after `PlayableCard.Die`| +|`IOnOtherCardDealtDamageInHand`|Called on card's in the player's hand| ## Card Death Handled by `PlayableCard.Die`. |Trigger|Additional information| |:-|:-| -|OnPreDeathAnimation|| -|OnOtherCardPreDeath|| -|IOnOtherCardPreDeathInHand|Called on cards in the player's hand| -|OnOtherCardDie|| -|IOnOtherCardDieInHand|Called on cards in the player's hand| +|`OnPreDeathAnimation`|| +|`OnOtherCardPreDeath`|| +|`IOnOtherCardPreDeathInHand`|Called on cards in the player's hand| +|`OnOtherCardDie`|| +|`IOnOtherCardDieInHand`|Called on cards in the player's hand| ## Card Drawing Handled by `PlayerHand.AddCardToHand`. |Trigger|Additional information| |:-|:-| -|OnDrawn|Called before a card is added to `cardsInHand`| -|OnOtherCardDrawn|Called before a card is added to `cardsInHand`| -|IOnAddedToHand|Called after a card is added to `cardsInHand`| -|IOtherCardAddedToHand|Called after a card is added to `cardsInHand`| +|`OnDrawn`|Called before a card is added to `cardsInHand`| +|`OnOtherCardDrawn`|Called before a card is added to `cardsInHand`| +|`IOnAddedToHand`|Called after a card is added to `cardsInHand`| +|`IOtherCardAddedToHand`|Called after a card is added to `cardsInHand`| ## Card Playing Handled by `BoardManager.TransitionAndResolveCreatedCard`, `BoardManager.ResolveCardOnBoard`, and `BoardManager.AssignCardToSlot`. |Trigger|Additional information| |:-|:-| -|OnOtherCardAssignedToSlot|| -|IOnCardAssignedToSlotContext|Provides information on new and old slot| -|IOnOtherCardAssignedToSlotInHand|Called on cards in the player's hand| -|IOnCardAssignedToSlotNoResolve|Only called if assigned card was already resolved| -|OnResolveOnBoard|Called when a card is played from the hand or queue| -|OnOtherCardResolve|Called when a card is played from the hand or queue| -|IOnOtherCardResolveInHand|Called on cards in the player's hand

Called when a card is played from the hand or queue| +|`OnOtherCardAssignedToSlot`|| +|`IOnCardAssignedToSlotContext`|Provides information on new and old slot| +|`IOnOtherCardAssignedToSlotInHand`|Called on cards in the player's hand| +|`IOnCardAssignedToSlotNoResolve`|Only called if assigned card was already resolved| +|`OnResolveOnBoard`|Called when a card is played from the hand or queue| +|`OnOtherCardResolve`|Called when a card is played from the hand or queue| +|`IOnOtherCardResolveInHand`|Called on cards in the player's hand

Called when a card is played from the hand or queue| ## Combat Phase Handled by `CombatPhaseManager.DoCombatPhase`, `CombatPhaseManager.SlotAttackSequence`, and `CombatPhaseManager.SlotAttackSlot`. @@ -62,33 +62,33 @@ Handled by `CombatPhaseManager.DoCombatPhase`, `CombatPhaseManager.SlotAttackSeq |Trigger|Additional information| |:-|:-| -|IOnBellRun|Called before `DoCombatPhase`| -|IOnPreSlotAttackSequence|Called before `SlotAttackSequence`| -|IGetAttackingSlots|Adds return value to current list of attacking slots, can modify current list within the method| -|ISetupAttackSequence|Replaces current list of targeted slots with return value

Called with priority `ReplacesDefaultOpposingSlot`| -|IGetOpposingSlots|Adds return value to current list of targeted slots, can modify current list within the method| -|ISetupAttackSequence|Replaces current list of targeted slots with return value

Called with priority `Normal`| -|ISetupAttackSequence|Replaces current list of targeted slots with return value

Called with priority `BringsBackOpposingSlot`| -|ISetupAttackSequence|Replaces current list of targeted slots with return value

Called with priority `PostAdditionModification`| -|OnSlotTargetedForAttack|| -|IModifyDirectDamage|Called only if direct damage is being dealt

Sets the damage being dealt to the returned value| -|OnDealDamageDirectly|| -|IOnCardDealtDamageDirectly|Called for every card on the board| -|OnCardGettingAttacked|Called only if a card is being attacked| -|IPostCardGettingAttacked|| -|IOnPostSingularSlotAttackSlot|Called after `SlotAttackSlot`| -|OnAttackEnded|Called after all cards have finished attacking| -|IOnPostSlotAttackSequence|Called after `SlotAttackSequence`| +|`IOnBellRun`|Called before `DoCombatPhase`| +|`IOnPreSlotAttackSequence`|Called before `SlotAttackSequence`| +|`IGetAttackingSlots`|Adds return value to current list of attacking slots, can modify current list within the method| +|`ISetupAttackSequence`|Replaces current list of targeted slots with return value

Called with priority `ReplacesDefaultOpposingSlot`| +|`IGetOpposingSlots`|Adds return value to current list of targeted slots, can modify current list within the method| +|`ISetupAttackSequence`|Replaces current list of targeted slots with return value

Called with priority `Normal`| +|`ISetupAttackSequence`|Replaces current list of targeted slots with return value

Called with priority `BringsBackOpposingSlot`| +|`ISetupAttackSequence`|Replaces current list of targeted slots with return value

Called with priority `PostAdditionModification`| +|`OnSlotTargetedForAttack`|| +|`IModifyDirectDamage`|Called only if direct damage is being dealt

Sets the damage being dealt to the returned value| +|`OnDealDamageDirectly`|| +|`IOnCardDealtDamageDirectly`|Called for every card on the board| +|`OnCardGettingAttacked`|Called only if a card is being attacked| +|`IPostCardGettingAttacked`|| +|`IOnPostSingularSlotAttackSlot`|Called after `SlotAttackSlot`| +|`OnAttackEnded`|Called after all cards have finished attacking| +|`IOnPostSlotAttackSequence`|Called after `SlotAttackSequence`| ## Consumable Items -Handled by `ConsumableItemSlot.ConsumeItem` and each ConsumableItem's `ActivateSequence`. +Handled by `ConsumableItemSlot.ConsumeItem` and each `ConsumableItem`'s `ActivateSequence`. |Trigger|Additional information| |:-|:-| -|IItemCanBeUsed|Can stop items from being used| -|IOnItemPreventedFromUse|Called if `IItemCanBeUsed` stopped an item from being used| -|IOnPreItemUsed|Called before `ConsumeItem` and `ActivateSequence`| -|IOnPostItemUsed|Called after `ConsumeItem` and `ActivateSequence`| +|`IItemCanBeUsed`|Can stop items from being used| +|`IOnItemPreventedFromUse`|Called if `IItemCanBeUsed` stopped an item from being used| +|`IOnPreItemUsed`|Called before `ConsumeItem` and `ActivateSequence`| +|`IOnPostItemUsed`|Called after `ConsumeItem` and `ActivateSequence`| ## Passive Stat Buffs Handled by `PlayableCard.GetPassiveAttackBuffs` and `PlayableCard.GetPassiveHealthBuffs`. @@ -97,22 +97,22 @@ These patches are called every frame. |Trigger|Additional information| |:-|:-| -|IOnCardPassiveAttackBuffs|Sets attack buff to returned value| -|IPassiveAttackBuffs|Adds to attack buff with returned value| +|`IOnCardPassiveAttackBuffs`|Sets attack buff to returned value| +|`IPassiveAttackBuffs`|Adds to attack buff with returned value| |Trigger|Additional information| |:-|:-| -|IOnCardPassiveHealthBuffs|Sets health buff to returned value| -|IPassiveHealthBuffs|Adds to health buff with returned value| +|`IOnCardPassiveHealthBuffs`|Sets health buff to returned value| +|`IPassiveHealthBuffs`|Adds to health buff with returned value| ## Scale Damage Handled by `LifeManager.ShowDamageSequence`. |Trigger|Additional information| |:-|:-| -|IOnPreScalesChangedRef|Modifies the damage being dealt and weights being added to the physical scale| -|IOnPreScalesChanged|Called before `ShowDamageSequence`| -|IOnPostScalesChanged|Called after `ShowDamageSequence`| +|`IOnPreScalesChangedRef`|Modifies the damage being dealt and weights being added to the physical scale| +|`IOnPreScalesChanged`|Called before `ShowDamageSequence`| +|`IOnPostScalesChanged`|Called after `ShowDamageSequence`| ## Turn Sequence Handled by `TurnManager.GameSequence`, `TurnManager.PlayerTurn`, `TurnManager.OpponentTurn`, `TurnManager.DoUpkeepPhase`. @@ -121,8 +121,8 @@ Triggers for the opponent's turn are not called if their turn is skipped. |Trigger|Additional information| |:-|:-| -|OnUpkeep|| -|IOnUpkeepInHand|Called on cards in the player's hand| -|OnTurnEnd|Called after `DoCombatPhase`| -|IOnTurnEndInQueue|Called on cards in the opponent's queue| -|IOnTurnEndInHand|Called on cards in the player's hand| +|`OnUpkeep`|| +|`IOnUpkeepInHand`|Called on cards in the player's hand| +|`OnTurnEnd`|Called after `DoCombatPhase`| +|`IOnTurnEndInQueue`|Called on cards in the opponent's queue| +|`IOnTurnEndInHand`|Called on cards in the player's hand|