Eclipsed Price Raise

版本 v1.0.0·更新於 2024-10-11

Increases price of scrap on eclipsed planets.

模組介紹 作者原文

This is the template, I was too lazy to change it.

Lethal Company Mod Template

Thank you for using the mod template! Here are a few tips to help you on your journey:

Versioning

BepInEx uses semantic versioning, or semver, for the mod's version info.

To increment it, you can either modify the version tag in the.csproj file directly, or use your IDE's UX to increment the version. Below is an example of modifying the.csproj file directly:

EclipsedPriseRaise

EclipsedPriseRaise

1.0.0

Your IDE will have the setting in Package or NuGet under General or Metadata, respectively.

Logging

A logger is provided to help with logging to the console.

You can access it by doing Plugin.Logger in any class outside the Plugin class.

Please use LogDebug() *whenever possible, as any other log method

will be displayed to the console and potentially cause performance issues for users.*

If you chose to do so, make sure you change the following line in the BepInEx.cfg file to see the Debug messages:

[Logging.Console]... #

Which log levels to show in the console output.

Setting type: LogLevel

Default value: Fatal, Error, Warning, Message, Info

Acceptable values: None, Fatal, Error, Warning, Message, Info, Debug, All

Multiple values can be set at the same time by separating them with, (e.g. Debug, Warning)

LogLevels = All

Harmony

This template uses harmony. For more specifics on how to use it, look at

the HarmonyX GitHub wiki and

the Harmony docs.

To make a new harmony patch, just use [HarmonyPatch] before any class you make that has a patch in it.

Then in that class, you can use

[HarmonyPatch(typeof(ClassToPatch), "MethodToPatch")]

where ClassToPatch is the class you're patching (ie TVScript), and MethodToPatch is the method you're patching (ie SwitchTVLocalClient).

Then you can use

the appropriate prefix, postfix, transpiler, or finalizer attribute.

_While you can use_ return false; _in a prefix patch,

it is HIGHLY DISCOURAGED as it can AND WILL cause compatibility issues with other mods._

For example, we want to add a patch that will debug log the current players' position.

We have the following postfix patch patching the SwitchTVLocalClient method

in TVScript:

using HarmonyLib;

namespace EclipsedPriseRaise.Patches;

[HarmonyPatch(typeof(TVScript))]

public class ExampleTVPatch

{

[HarmonyPatch("SwitchTVLocalClient")]

[HarmonyPrefix]

private static void SwitchTvPrefix(TVScript __instance)

{

/*

  • When the method is called, the TV will be turning off when we want to
  • turn the lights on and vice-versa. At that time, the TV's tvOn field
  • will be the opposite of what it's doing, ie it'll be on when turning off.
  • So, we want to set the lights to what the tv's state was
  • when this method is called.

*/

StartOfRound.Instance.shipRoomLights.SetShipLightsBoolean(__instance.tvOn);

}

}

In this case we include the type of the class we're patching in the attribute

before our ExampleTVPatch class,

as our class will only patch the TVScript class.

安裝與使用 安裝:BepInEx 外掛

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

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

檔案與校驗

檔案名稱
Eclipsed_Price_Raise-1.0.0.zip
檔案大小
22.8 KiB