0 of 0

File information

Last updated

Original upload

Created by

emazia

Uploaded by

emazia

Virus scan

Safe to use

Tags for this mod

About this mod

Makes hidden fairy chests visible on map

Requirements
Permissions and credits
Some fairy chests in the game are hidden behind breakable walls and not marked on the map, requiring you to remember room layouts or look carefully for breakable walls in every room. No more! This mod makes it so fairy chests are shown on the map when entering the room.

Installation:
  • Install RL2 ModLoader: https://github.com/RL2-API/RL2.ModLoader
  • Download the mod file UnhiddenFairyChests.zip
  • Move the dll and json file to the RL2 "Mods" folder
    Example path for Steam: C:\Program Files (x86)\Steam\steamapps\common\Rogue Legacy 2\Rogue Legacy 2_Data\Mods


Supported versions:
The mod is built and tested for Rogue Legacy 2 version V1.2.2a-steam and RL2 ModLoader version V.1.0.4

Source code: (can't be bothered making a github repo)

using System;
using System.Linq;
using UnityEngine;

namespace rl2mod
{
[ModEntrypoint]
public class Class1
{
public Class1()
{
Messenger<GameMessenger, GameEvent>.AddListener(GameEvent.PlayerEnterRoom, ShowFairyChests);
Messenger<GameMessenger, GameEvent>.AddListener(GameEvent.EnemyDeath, ShowFairyChests);

void ShowFairyChests(MonoBehaviour arg1, EventArgs arg2)
{
if (PlayerManager.GetCurrentPlayerRoom() is not { } baseRoom)
return;

var fairyChests =
baseRoom.SpawnControllerManager.ChestSpawnControllers
.Where(c => c is
{
ShouldSpawn: true, ChestType: ChestType.Fairy,
ChestInstance: { IsOpen: false, IsLocked: false }
})
.ToList();

if (fairyChests.Count == 0)
return;

if (MapController.GetMapRoomEntry(baseRoom.BiomeType, baseRoom.BiomeControllerIndex) is
not { } mapRoomEntry)
{
return;
}

foreach (var chest in fairyChests)
{
mapRoomEntry.ToggleIconVisibility(MapIconType.ChestClosed, chest.ChestIndex, true);
}
}
}
}
}