CustomAttributes

版本 v1.1.0·更新於 2023-10-19

This is a dependency used by other mods to process new custom stats. Modders can make use of the new custom attributes and make all our mods compatible.

模組介紹 作者原文

CustomAttributes Dependency Mod

This is a dependency used by other mods to process new custom stats.

  • Critical Hit Chance (chance to deal increased damage on direct hits, doesnt trigger from damage over time)
  • Critical Heal Chance (chance to deal increased healing, from direct heals and heal over time)
  • Critical Scaling (increases the effects of critical hits and critical heals) (50% by default)
  • Avoidance (chance to completely avoid a direct hit, can not trigger from damage over time)
  • Leech (restore a percentage of damage dealt to your stamina or mana, whichever percent is lower)
  • Self Critical (chance to be critically hit by enemies instead)

Note: CriticalHit, CriticalHeal and Avoidance have bad luck protection for players, slightly increasing the chance of success every failed attempt, to prevent bad luck streaks. Like most games do.

For user: Just download if a mod tags it as a dependency (r2modman should download automatically)

For Modders: You can all make use of the new custom attributes and make all our mods compatible and work together!

Any suggestions are also welcome.

--- HOW TO IMPLEMENT TO YOUR MOD (c# only)---

  • Add the.dll as a reference in your c# project.
  • Remember to add "using CustomAttributes; at the top of your c# class."
  • On your base plugin "Awake" method, we need to tell the game which Passives or StatusEffects grant what CustomAttribute and by how much (detailed in the next section).
  • Optionally, If you need to run custom code when certain event happens (like a critical hit), when can subscribe to events in the "Start" method.
  • Thats it! The mod will calculate the total stats from all mods and do the appropriate calculations and effects.

--- CustomAttributes Methods() with examples ---

Store Passives (this is added on Awake() method)

Passives stored this way will grant whatever percent you add, of the specified attribute/s

("value" is the Attribute percent you want to add. Ex: 10 would add 10% of that attribute)

Call the CustomAttributeHelper and run the method you need

  • PassiveCritRateStore(int skillID, float value)
  • PassiveCritHealStore(int skillID, float value)
  • PassiveCritScalingStore(int skillID, float value)
  • PassiveAvoidanceStore(int skillID, float value)
  • PassiveLeechStore(int skillID, float value)
  • PassiveSelfCritStore(int skillID, float value)

Example: This would make the Passive skill "Fitness" with ID 8205040 grant 10% critical hit chance

internal void Awake() { CustomAttributeHelper.PassiveCritRateStore(8205040, 10f); }

Store StatusEffects (this is added on Awake() method)

StatusEffects stored this way will TEMPORARILY grant whatever percent you add, of the specified attribute/s

(it also works with leveled status effects, stacking per status level)

("value" is the Attribute percent you want to add. Ex: 10 would add 10% of that attribute)

Call the CustomAttributeHelper and run the method you need

  • StatusCritRateStore(string skillID, float value)
  • StatusCritHealStore(string skillID, float value)
  • StatusCritScalingStore(string skillID, float value)
  • StatusAvoidanceStore(string skillID, float value)
  • StatusLeechStore(string skillID, float value)
  • StatusSelfCritStore(string skillID, float value)

Example: This would make the StatusEffect "Rage" grant 5% avoid chance

internal void Awake() { CustomAttributeHelper.StatusAvoidanceStore("Rage", 5f); }

Running Custom code after events (this is added on Start() method)

You can trigger special code when a player deals a critical hit, critical heal, if they avoid a hit or if critically hit by an npc.

Call a CustomAttributesBase instance and subscribe to the event you need

  • OnCharacterCritEvent += YOUR CUSTOM METHOD HERE
  • OnCharacterCritHealEvent += YOUR CUSTOM METHOD HERE
  • OnCharacterAvoidEvent += YOUR CUSTOM METHOD HERE
  • OnCharacterSelfCritFromAI += YOUR CUSTOM METHOD HERE

Example: This would run a custom method on your mod whenever a player critically heals succesfully

internal void Start() { CustomAttri

安裝與使用 安裝:BepInEx 外掛

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

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

前置依賴

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

BepInEx-BepInExPack_Outward

檔案與校驗

檔案名稱
CustomAttributes-1.1.0.zip
檔案大小
30.9 KiB
SHA-256
b280672381cc1145585763ee2e5b81db0eb1df7b0239922b469b8d55c3c5bdbe
入庫時間
2026-10-06 19:08