Adding even More Slugcats

This page lists the steps for adding your own custom slugcat to AndrewFM's "More Slugcats" mod, which can be downloaded from https://maxtcc.github.io/.

-- Note: this is outdated too since the link dosen't work and i think some of this code isn't good for the latest version of Rain World

**Requirements**: dnSpy, an image editing program and the modded assembly for More Slugcats.

## Portrait files

Navigate to "*Rain World\Assets\Futile\Resources\Illustrations*" (this is where you installed the image files for the mod. Copy a slugcat\_x.png file and a SlugcatPortrait\_x.png file. Edit these to suit the needs of your slugcat, and save them as slugcat\_7.png and SlugcatPortrait\_7.png, respectively.

After saving the files, place them in the folder mentioned above.

## DeathPersistentSaveData

Using dnSpy, navigate to the *DeathPersistentSaveData* class. Once there, locate the SlugcatType enum and add a new field to it. Name this whatever you want, and use a value higher than 6.

Then, navigate to the *SaveToString* method. In there, you will find several pieces of code similar to this:

```
else if (this.slugcatType == DeathPersistentSaveData.SlugcatType.MONKCAT)

{

    text += "MONKCAT<dpA>";

}

```

Add a new piece of code after this one, but replace MONKCAT with what you named your field in SlugcatType.

Then, navigate to the *FromString* method. Find this piece of code:

```
else if (a == "MONKCAT")

{

    this.slugcatType = DeathPersistentSaveData.SlugcatType.MONKCAT;

}

```

After this piece of code, add an identical one but, again, replace MONKCAT with whatever your SlugcatType field was named.

## SlugcatSelectMenu

Using dnSpy, navigate to the constructor method of *Menu.SlugcatSelectMenu*. Once there, find this piece of code:

```
for (int j = 1; j <= 6; j++)

{

    this.slugcatIllustrations.Add(new MenuIllustration(this, this.pages[0], string.Empty, "slugcat_" + j.ToString(), new Vector2(0.01f, 0.01f), true, false));

}

```

Change that 6 to a 7. This will you allow you to add one slugcat.

Next, you'll need to adjust the placement of the new menu button that will appear. Find this piece of code:

```
for (int k = 0; k < this.slugcatIllustrations.Count; k++)

{

    if (k < (this.slugcatIllustrations.Count - 1) / 2)

    {

        this.slugcatIllustrations[k].pos.x = num - num3 - 5f;

    }

    else

    {

        this.slugcatIllustrations[k].pos.x = num + num3 - 5f;

    }

```

For the sake of the tutorial, we will manually adjust the position of the single new menu button we're adding. Just after the piece of code above, add this:

```
if (k == 6)

{

   this.slugcatIllustrations[k].pos.x = num - num3 - 115f;

}

```

Now, navigate to the *SetPortraitData* method.

After the piece of code for MONKCAT, add the following piece of code.

```
if (id == 0)

{

   this.slugcatPortraitFacts.text = "The traditional slugcat choice.\n\n+ Well balanced, suitable for new players.\n+ The game as it was meant to be played.";

   this.manager.rainWorld.persistentData.selectedSlugcat = DeathPersistentSaveData.SlugcatType.NORMAL;

   return;

}

```

Change the 0 to a 6, change the description string to whatever you want (try to follow the format) and change the NORMAL to what you named your SlugcatType.

## Customizing your Slugcat

You can do lots of things when customizing your slugcat! Try going into the *Player* or *PlayerGraphics* classes.

In here, you can add custom code that only activates when your're using your newly added slugcat. If you want to check if your slugcat is being used, this is a good way to do it:

```
if ((this.player.room.game.session as StoryGameSession).saveState.deathPersistentSaveData.slugcatType == DeathPersistentSaveData.SlugcatType.AXOCAT)

{

   //Your code here.

}

```

Of course, the AXOCAT would be replaced with your SlugcatType field.