LCMaskedInfestationMod

版本 v1.0.1·更新於 2026-04-07

Add the possibility for infestations to spawn Maskeds!

模組介紹 作者原文

COMPANY-MANDATED MESSAGE:

Wait, when did we hire THIS many...? Ohhhhhh! Oh. Oh no...

Uhhh- Dear employees, we advice you to proceed with caution on your travels throughout the various facilities, as there appears to be a sudden spike in the amount of possessed masked ex-employees wandering their halls. We suspect this phenomenon finds its roots in, and functions similarly to, the same rare event that can cause an outburst of Linepithema-crassus (the so-called 'Hoarding Bugs'), and fear it can be just as dangerous, if not more.

And not only that, but these possessed souls have lost their will to collect scrap for the Company, so clearly having them goof off en masse is unforgivable. So get to it, real employees, chop-chop!

That is all for this message. We hope you stay a great asset to the Company.

The Mod

Introduction:

Get ready for facilities filled with fakers...

This mod adds the possibility for infestations to not only spawn the default enemies, but also Maskeds! Just like with regular infestations, there will already be a few waiting for you at the start of the day, and the moon's interior (and exterior too, don't forget) will quickly fill up to their max amount.

Have fun!

Creation:

  • I wanted to learn HarmonyLib Transpilers
  • Conclusion: scary stuff
  • In terms of how this specific Transpiler works (if it works at all, I hope):
  • The Transpiler itself just uses a Transpilers.EmitDelegate(delegate () { });
  • I don't actually know what this means, so far I just understand this lets me inject whatever is between the curly brackets at the moment I later specify
  • It checks the RoundManager's RefreshEnemiesList(), since this is where the enemyRushIndex is assigned
  • It then checks for where it asks the date from DateTime, as this is right before any checks for starting an infestation in the vanilla game happen
  • If it finds that, it saves that as the index to remove code from and insert my own
  • Then, if it's saved an index, it will jump back one iteration in the List of CodeInstructions (as I believe nothing is loaded into the callstack at that moment) and remove the following 152 CodeInstructions
  • This encapsulates the checking of the current date, creating a new random number generator, and the entire if-statement about infestations, right up until the moment it sets the currentMaxOutsidePowerCount
  • It removes all of this, and then inserts the above function from EmitDelegate, which is a carbon-copy of the original method with an extra else-if-statement between the Nutcracker's check and the default Hoarding bug infestation assignment
  • This is not the prettiest way, nor how I had hoped to do this, but I had trouble finding a satisfying way to insert a C# else-if without the context of the original method around it
  • On top of that, I wanted to keep the method as intact as possible, and therefore also had to include the check to DateTime and the new System.Random it would draw Next() random numbers from. So, I chose to jump in at a clean moment, remove everything up until the entire body with checks would finish, and replace it with a new yet identical version of the body, albeit with... complete control over every line of code now
  • So the chances of infestations are not altered, and Maskeds have the exact same odds of being picked as Nutcrackers, and set the currentMaxInsidePower to the same value of 20
  • I also added some debug lines throughout the Transpiler's inserted code, just as a way to check for myself if inserting code worked at all, and what the specific states of the method were while moving through it
  • And to try to catch errors, I also check 152 iterations ahead of the DateTime function, and see if it is the same CodeInstruction.ToString() as from the vanilla game. If not, it will return RefreshEnemiesList() in the exact way as it is in the original code, to hopefully prevent conflicts and gamebreaking bugs
  • For clarity's sake: This is a client-side mod using the host's data.
  • As far

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPack

檔案與校驗

檔案名稱
LCMaskedInfestationMod-1.0.1.zip
檔案大小
109.7 KiB