Merge branch 'main' into race-chains-and-stations
# Conflicts: # JotunnModStub/Aswid/AswidRace.cs # JotunnModStub/Factions/FactionHostilityPatch.cs # JotunnModStub/Factions/FactionMerchantCatalog.cs # JotunnModStub/Furling/FurlingPatches.cs
This commit is contained in:
commit
f60b8d8f7d
48 changed files with 1865 additions and 380 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -25,3 +25,6 @@ Thumbs.db
|
||||||
# Windows shortcuts hold an absolute path to the machine that made them, so they
|
# Windows shortcuts hold an absolute path to the machine that made them, so they
|
||||||
# resolve for nobody else who clones this repo.
|
# resolve for nobody else who clones this repo.
|
||||||
*.lnk
|
*.lnk
|
||||||
|
|
||||||
|
# How to setup Configuration Manager
|
||||||
|
CONFIGURATION-MANAGER-HOWTO.md
|
||||||
133
JotunnModStub/Aswid/AswidConfig.cs
Normal file
133
JotunnModStub/Aswid/AswidConfig.cs
Normal file
|
|
@ -0,0 +1,133 @@
|
||||||
|
using UnityEngine;
|
||||||
|
using BepInEx.Configuration;
|
||||||
|
|
||||||
|
namespace RacesOfValheim
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Every tunable number and keybind behind the Aswid's abilities, bound as BepInEx ConfigEntry
|
||||||
|
/// so they show up in Configuration Manager without touching code - see
|
||||||
|
/// CONFIGURATION-MANAGER-HOWTO.md. Bound once, from RacesOfValheim.Awake(). One section per
|
||||||
|
/// topic (matches SkadiConfig's layout) rather than one shared section, so each shows up as
|
||||||
|
/// its own entry in Configuration Manager's category list.
|
||||||
|
///
|
||||||
|
/// Tier-gate thresholds (which progression state unlocks Mist Form, Eclipse, or which mob a
|
||||||
|
/// given tier can tame) are left as-is, same boundary drawn for Skadi's progression table -
|
||||||
|
/// these are a differently-shaped piece of config (per-tier unlock tables, not flat values).
|
||||||
|
/// </summary>
|
||||||
|
public static class AswidConfig
|
||||||
|
{
|
||||||
|
// ─── Keybinds ──────────────────────────────────────────────────────────
|
||||||
|
// Defaults match today's fixed inputs exactly, so nobody's controls change until they
|
||||||
|
// open Configuration Manager (or the .cfg) and rebind one on purpose.
|
||||||
|
public static ConfigEntry<KeyboardShortcut> BatFormKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> MistFormKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> EclipseKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> TameKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> ToggleDevourKey;
|
||||||
|
|
||||||
|
// ─── Passive combat (scales with progression state, doubles at night) ────
|
||||||
|
public static ConfigEntry<float> DamageBonusPerState;
|
||||||
|
public static ConfigEntry<float> ArmorBonusPerState;
|
||||||
|
public static ConfigEntry<float> SpeedBonusPerState;
|
||||||
|
public static ConfigEntry<float> NightMultiplier;
|
||||||
|
public static ConfigEntry<float> BloodMagicSkillGainMultiplier;
|
||||||
|
public static ConfigEntry<float> SurtlingFormDamageBonus;
|
||||||
|
|
||||||
|
// ─── Vampiric Aura (passive, always active) ──────────────────────────────
|
||||||
|
public static ConfigEntry<float> AuraTickInterval;
|
||||||
|
public static ConfigEntry<float> AuraRadiusDay;
|
||||||
|
public static ConfigEntry<float> AuraRadiusNight;
|
||||||
|
public static ConfigEntry<float> AuraBaseDamage;
|
||||||
|
public static ConfigEntry<float> AuraBloodMagicScaling;
|
||||||
|
public static ConfigEntry<float> AuraExecuteThreshold;
|
||||||
|
|
||||||
|
// ─── Superhuman Senses (tier 5+ passive) ─────────────────────────────────
|
||||||
|
public static ConfigEntry<float> SensesRadius;
|
||||||
|
public static ConfigEntry<float> SensesRefreshInterval;
|
||||||
|
public static ConfigEntry<float> SensesLightRange;
|
||||||
|
public static ConfigEntry<float> SensesLightIntensity;
|
||||||
|
|
||||||
|
// ─── Eclipse (tier 6+ ability) ────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> EclipseCooldown;
|
||||||
|
public static ConfigEntry<float> EclipseCastTime;
|
||||||
|
public static ConfigEntry<float> EclipseDuration;
|
||||||
|
|
||||||
|
// ─── Devour ────────────────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> DevourCooldown;
|
||||||
|
|
||||||
|
// ─── Domination (tier 6+ ability, native Interact key) ───────────────────
|
||||||
|
public static ConfigEntry<float> EnslaveCooldown;
|
||||||
|
public static ConfigEntry<float> ThrallLifetime;
|
||||||
|
|
||||||
|
public static void Bind(ConfigFile config)
|
||||||
|
{
|
||||||
|
const string keybinds = "Aswid - Keybinds";
|
||||||
|
BatFormKey = config.Bind(keybinds, "Bat Form", new KeyboardShortcut(KeyCode.G),
|
||||||
|
new ConfigDescription("Transform into (or revert from) a Bat, tier 2+ (night only) / tier 3+ (any time)."));
|
||||||
|
MistFormKey = config.Bind(keybinds, "Mist Form Toggle", new KeyboardShortcut(KeyCode.H),
|
||||||
|
new ConfigDescription("Become (or revert from) mist, tier 7+."));
|
||||||
|
EclipseKey = config.Bind(keybinds, "Cast Eclipse", new KeyboardShortcut(KeyCode.J),
|
||||||
|
new ConfigDescription("Casts Eclipse, tier 6+. Fails silently at night."));
|
||||||
|
TameKey = config.Bind(keybinds, "Tame", new KeyboardShortcut(KeyCode.U),
|
||||||
|
new ConfigDescription("Tames the creature under your cursor, if your tier allows it."));
|
||||||
|
ToggleDevourKey = config.Bind(keybinds, "Toggle Devour Ability", new KeyboardShortcut(KeyCode.I),
|
||||||
|
new ConfigDescription("Turns the automatic Devour-on-kill behavior on or off."));
|
||||||
|
|
||||||
|
const string combat = "Aswid - Passive Combat";
|
||||||
|
DamageBonusPerState = config.Bind(combat, "Damage Bonus Per State", 2f,
|
||||||
|
new ConfigDescription("Flat physical damage added to equipped weapons, per progression state.", new AcceptableValueRange<float>(0f, 10f)));
|
||||||
|
ArmorBonusPerState = config.Bind(combat, "Armor Bonus Per State", 1f,
|
||||||
|
new ConfigDescription("Flat armor added, per progression state.", new AcceptableValueRange<float>(0f, 10f)));
|
||||||
|
SpeedBonusPerState = config.Bind(combat, "Speed Bonus Per State", 0.01f,
|
||||||
|
new ConfigDescription("Move/jump speed multiplier added, per progression state (0.01 = 1%).", new AcceptableValueRange<float>(0f, 0.1f)));
|
||||||
|
NightMultiplier = config.Bind(combat, "Night Multiplier", 2f,
|
||||||
|
new ConfigDescription("Multiplies the speed, armor, damage, and lifesteal bonuses above while it is night.", new AcceptableValueRange<float>(1f, 5f)));
|
||||||
|
BloodMagicSkillGainMultiplier = config.Bind(combat, "Blood Magic Skill Gain Multiplier", 2f,
|
||||||
|
new ConfigDescription("Multiplies how fast the Blood Magic skill levels up.", new AcceptableValueRange<float>(0.5f, 5f)));
|
||||||
|
SurtlingFormDamageBonus = config.Bind(combat, "Surtling Form Damage Bonus", 30f,
|
||||||
|
new ConfigDescription("Flat damage added to every attack once the tier 8 Surtling form is unlocked.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
|
||||||
|
const string aura = "Aswid - Vampiric Aura";
|
||||||
|
AuraTickInterval = config.Bind(aura, "Tick Interval", 0.25f,
|
||||||
|
new ConfigDescription("Seconds between aura damage/lifesteal ticks.", new AcceptableValueRange<float>(0.05f, 2f)));
|
||||||
|
AuraRadiusDay = config.Bind(aura, "Radius (Day)", 3f,
|
||||||
|
new ConfigDescription("Meters from the player that the aura drains during the day.", new AcceptableValueRange<float>(1f, 20f)));
|
||||||
|
AuraRadiusNight = config.Bind(aura, "Radius (Night)", 6f,
|
||||||
|
new ConfigDescription("Meters from the player that the aura drains at night.", new AcceptableValueRange<float>(1f, 20f)));
|
||||||
|
AuraBaseDamage = config.Bind(aura, "Base Damage", 1f,
|
||||||
|
new ConfigDescription("Damage per tick before the Blood Magic skill bonus, at human form's 0.5x multiplier.", new AcceptableValueRange<float>(0f, 20f)));
|
||||||
|
AuraBloodMagicScaling = config.Bind(aura, "Blood Magic Damage Scaling", 5f,
|
||||||
|
new ConfigDescription("Extra damage per tick at 100 Blood Magic skill (scales linearly from 0).", new AcceptableValueRange<float>(0f, 20f)));
|
||||||
|
AuraExecuteThreshold = config.Bind(aura, "Execute Threshold", 0.20f,
|
||||||
|
new ConfigDescription("Non-boss enemies at or below this fraction of max health are executed by the aura instead of merely damaged.", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
|
||||||
|
const string senses = "Aswid - Superhuman Senses";
|
||||||
|
SensesRadius = config.Bind(senses, "Detection Radius", 100f,
|
||||||
|
new ConfigDescription("Meters within which nearby creatures are marked, tier 5+.", new AcceptableValueRange<float>(10f, 300f)));
|
||||||
|
SensesRefreshInterval = config.Bind(senses, "Refresh Interval", 1f,
|
||||||
|
new ConfigDescription("Seconds between detection sweeps.", new AcceptableValueRange<float>(0.2f, 5f)));
|
||||||
|
SensesLightRange = config.Bind(senses, "Marker Light Range", 10f,
|
||||||
|
new ConfigDescription("Range of the light placed on a detected creature.", new AcceptableValueRange<float>(1f, 30f)));
|
||||||
|
SensesLightIntensity = config.Bind(senses, "Marker Light Intensity", 2f,
|
||||||
|
new ConfigDescription("Intensity of the light placed on a detected creature.", new AcceptableValueRange<float>(0.1f, 10f)));
|
||||||
|
|
||||||
|
const string eclipse = "Aswid - Eclipse";
|
||||||
|
EclipseCooldown = config.Bind(eclipse, "Cooldown", 900f,
|
||||||
|
new ConfigDescription("Seconds between casts.", new AcceptableValueRange<float>(0f, 3600f)));
|
||||||
|
EclipseCastTime = config.Bind(eclipse, "Cast Time", 2f,
|
||||||
|
new ConfigDescription("Seconds the player is rooted while casting.", new AcceptableValueRange<float>(0f, 10f)));
|
||||||
|
EclipseDuration = config.Bind(eclipse, "Duration", 60f,
|
||||||
|
new ConfigDescription("Seconds the forced night lasts.", new AcceptableValueRange<float>(5f, 600f)));
|
||||||
|
|
||||||
|
const string devour = "Aswid - Devour";
|
||||||
|
DevourCooldown = config.Bind(devour, "Consume Cooldown", 5f,
|
||||||
|
new ConfigDescription("Minimum seconds between devouring a corpse, outside of an execute (which bypasses this).", new AcceptableValueRange<float>(0f, 60f)));
|
||||||
|
|
||||||
|
const string domination = "Aswid - Domination";
|
||||||
|
EnslaveCooldown = config.Bind(domination, "Enslave Cooldown", 900f,
|
||||||
|
new ConfigDescription("Seconds between dominating a creature, tier 6+.", new AcceptableValueRange<float>(0f, 3600f)));
|
||||||
|
ThrallLifetime = config.Bind(domination, "Thrall Lifetime", 60f,
|
||||||
|
new ConfigDescription("Seconds a dominated thrall survives before it dies on its own.", new AcceptableValueRange<float>(10f, 600f)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -177,8 +177,8 @@ namespace RacesOfValheim
|
||||||
if (__instance == Player.m_localPlayer && AswidRace.IsAswid())
|
if (__instance == Player.m_localPlayer && AswidRace.IsAswid())
|
||||||
{
|
{
|
||||||
int state = BossProgressionManager.GetCurrentProgressionState();
|
int state = BossProgressionManager.GetCurrentProgressionState();
|
||||||
float multiplier = (EnvMan.instance != null && EnvMan.IsNight()) ? 2f : 1f;
|
float multiplier = (EnvMan.instance != null && EnvMan.IsNight()) ? AswidConfig.NightMultiplier.Value : 1f;
|
||||||
__result += 1f * state * multiplier;
|
__result += AswidConfig.ArmorBonusPerState.Value * state * multiplier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -203,8 +203,8 @@ namespace RacesOfValheim
|
||||||
int state = BossProgressionManager.GetCurrentProgressionState();
|
int state = BossProgressionManager.GetCurrentProgressionState();
|
||||||
if (state > 0)
|
if (state > 0)
|
||||||
{
|
{
|
||||||
float multiplier = (EnvMan.instance != null && EnvMan.IsNight()) ? 2f : 1f;
|
float multiplier = (EnvMan.instance != null && EnvMan.IsNight()) ? AswidConfig.NightMultiplier.Value : 1f;
|
||||||
float bonus = 2f * state * multiplier;
|
float bonus = AswidConfig.DamageBonusPerState.Value * state * multiplier;
|
||||||
|
|
||||||
// Add flat bonus to physical damage types that the weapon already has
|
// Add flat bonus to physical damage types that the weapon already has
|
||||||
if (__result.m_slash > 0) __result.m_slash += bonus;
|
if (__result.m_slash > 0) __result.m_slash += bonus;
|
||||||
|
|
@ -463,7 +463,11 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
if (canTame)
|
if (canTame)
|
||||||
{
|
{
|
||||||
__result += "\n[<color=yellow><b>K</b></color>] Tame";
|
// Used to hardcode "[K] Tame" while AswidRace.Update actually checked U (now
|
||||||
|
// AswidConfig.TameKey) - the hint never matched the working key, and would have
|
||||||
|
// gone stale again the moment that key was rebound. MainKey.ToString() reads back
|
||||||
|
// whatever is actually bound.
|
||||||
|
__result += $"\n[<color=yellow><b>{AswidConfig.TameKey.Value.MainKey}</b></color>] Tame";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -525,7 +529,7 @@ namespace RacesOfValheim
|
||||||
ZNetView nview = __instance.GetComponent<ZNetView>();
|
ZNetView nview = __instance.GetComponent<ZNetView>();
|
||||||
if (nview != null && nview.IsValid() && nview.GetZDO().GetString("RacesOfValheim_Race", "Human") == "Aswid")
|
if (nview != null && nview.IsValid() && nview.GetZDO().GetString("RacesOfValheim_Race", "Human") == "Aswid")
|
||||||
{
|
{
|
||||||
if (__instance == Player.m_localPlayer && RaceInput.Allowed && Input.GetKeyDown(KeyCode.I))
|
if (__instance == Player.m_localPlayer && RaceInput.Allowed && AswidConfig.ToggleDevourKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
AswidRace.DevourEnabled = !AswidRace.DevourEnabled;
|
AswidRace.DevourEnabled = !AswidRace.DevourEnabled;
|
||||||
string msg = AswidRace.DevourEnabled ? "Devour Ability: ENABLED" : "Devour Ability: DISABLED";
|
string msg = AswidRace.DevourEnabled ? "Devour Ability: ENABLED" : "Devour Ability: DISABLED";
|
||||||
|
|
@ -647,7 +651,7 @@ namespace RacesOfValheim
|
||||||
float lifesteal = rules.LifestealPercent;
|
float lifesteal = rules.LifestealPercent;
|
||||||
if (EnvMan.instance != null && EnvMan.IsNight())
|
if (EnvMan.instance != null && EnvMan.IsNight())
|
||||||
{
|
{
|
||||||
lifesteal *= 2f;
|
lifesteal *= AswidConfig.NightMultiplier.Value;
|
||||||
}
|
}
|
||||||
if (lifesteal > 0f)
|
if (lifesteal > 0f)
|
||||||
{
|
{
|
||||||
|
|
@ -738,7 +742,7 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
if (skillType == Skills.SkillType.BloodMagic)
|
if (skillType == Skills.SkillType.BloodMagic)
|
||||||
{
|
{
|
||||||
factor *= 2f; // Benedictus et Afflictus: Double speed for Blood Magic
|
factor *= AswidConfig.BloodMagicSkillGainMultiplier.Value; // Benedictus et Afflictus
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ namespace RacesOfValheim
|
||||||
// StartsWith("Fenring") already covers Fenring_Cultist. "Fuling" was
|
// StartsWith("Fenring") already covers Fenring_Cultist. "Fuling" was
|
||||||
// never a prefab prefix - the family is Goblin* - so that arm of the
|
// never a prefab prefix - the family is Goblin* - so that arm of the
|
||||||
// test matched nothing until now.
|
// test matched nothing until now.
|
||||||
if (mobName.StartsWith("Fenring") || mobName.StartsWith("Goblin"))
|
if (mobName == "Cultist" || mobName.StartsWith("Fenring") || mobName.StartsWith("Goblin"))
|
||||||
{
|
{
|
||||||
burnTime = 1200f; // 20 minutes
|
burnTime = 1200f; // 20 minutes
|
||||||
}
|
}
|
||||||
|
|
@ -193,7 +193,7 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
DateTime lastTime = new DateTime(ticks);
|
DateTime lastTime = new DateTime(ticks);
|
||||||
float elapsed = (float)(DateTime.Now - lastTime).TotalSeconds;
|
float elapsed = (float)(DateTime.Now - lastTime).TotalSeconds;
|
||||||
float cooldown = (15f * 60f) - elapsed;
|
float cooldown = AswidConfig.EnslaveCooldown.Value - elapsed;
|
||||||
return Mathf.Max(0f, cooldown);
|
return Mathf.Max(0f, cooldown);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -234,7 +234,7 @@ namespace RacesOfValheim
|
||||||
sensesCheckTimer -= Time.deltaTime;
|
sensesCheckTimer -= Time.deltaTime;
|
||||||
if (sensesCheckTimer <= 0f)
|
if (sensesCheckTimer <= 0f)
|
||||||
{
|
{
|
||||||
sensesCheckTimer = 1.0f; // Refresh every 1 second (TTL is 2s)
|
sensesCheckTimer = AswidConfig.SensesRefreshInterval.Value; // TTL is 2s
|
||||||
|
|
||||||
List<Character> allChars = Character.GetAllCharacters();
|
List<Character> allChars = Character.GetAllCharacters();
|
||||||
Vector3 myPos = Player.m_localPlayer.transform.position;
|
Vector3 myPos = Player.m_localPlayer.transform.position;
|
||||||
|
|
@ -247,7 +247,7 @@ namespace RacesOfValheim
|
||||||
if (c == null || c == Player.m_localPlayer || c.IsDead() || c.IsTamed()) continue;
|
if (c == null || c == Player.m_localPlayer || c.IsDead() || c.IsTamed()) continue;
|
||||||
|
|
||||||
float dist = Vector3.Distance(c.transform.position, myPos);
|
float dist = Vector3.Distance(c.transform.position, myPos);
|
||||||
if (dist <= 100f) // 100 meters detection radius
|
if (dist <= AswidConfig.SensesRadius.Value)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -264,8 +264,8 @@ namespace RacesOfValheim
|
||||||
Light pLight = lightObj.AddComponent<Light>();
|
Light pLight = lightObj.AddComponent<Light>();
|
||||||
pLight.type = LightType.Point;
|
pLight.type = LightType.Point;
|
||||||
pLight.color = Color.green;
|
pLight.color = Color.green;
|
||||||
pLight.range = 10f;
|
pLight.range = AswidConfig.SensesLightRange.Value;
|
||||||
pLight.intensity = 2f;
|
pLight.intensity = AswidConfig.SensesLightIntensity.Value;
|
||||||
pLight.shadows = LightShadows.None;
|
pLight.shadows = LightShadows.None;
|
||||||
|
|
||||||
activeSensesLight[c] = lightObj;
|
activeSensesLight[c] = lightObj;
|
||||||
|
|
@ -387,14 +387,14 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
if (RaceInput.Allowed)
|
if (RaceInput.Allowed)
|
||||||
{
|
{
|
||||||
if (Input.GetKeyDown(KeyCode.G)) { TryTransformWithRules(AswidProgression.GetGKeyRules(state)); return; }
|
if (AswidConfig.BatFormKey.Value.IsDown()) { TryTransformWithRules(AswidProgression.GetGKeyRules(state)); return; }
|
||||||
if (Input.GetKeyDown(KeyCode.H)) { TryToggleMistForm(); return; }
|
if (AswidConfig.MistFormKey.Value.IsDown()) { TryToggleMistForm(); return; }
|
||||||
if (Input.GetKeyDown(KeyCode.J))
|
if (AswidConfig.EclipseKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
TryCastEclipse(state);
|
TryCastEclipse(state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Input.GetKeyDown(KeyCode.U))
|
if (AswidConfig.TameKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
TryTameHoverObject(state);
|
TryTameHoverObject(state);
|
||||||
return;
|
return;
|
||||||
|
|
@ -768,7 +768,7 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
if (IsEclipseActive) return;
|
if (IsEclipseActive) return;
|
||||||
|
|
||||||
float cooldown = 900f; // 15 minutes
|
float cooldown = AswidConfig.EclipseCooldown.Value;
|
||||||
if (Time.time - lastEclipseTime < cooldown)
|
if (Time.time - lastEclipseTime < cooldown)
|
||||||
{
|
{
|
||||||
int remaining = (int)(cooldown - (Time.time - lastEclipseTime));
|
int remaining = (int)(cooldown - (Time.time - lastEclipseTime));
|
||||||
|
|
@ -795,7 +795,7 @@ namespace RacesOfValheim
|
||||||
Player.m_localPlayer.Message(MessageHud.MessageType.Center, "An Eclipse descends...");
|
Player.m_localPlayer.Message(MessageHud.MessageType.Center, "An Eclipse descends...");
|
||||||
|
|
||||||
float castTimer = 0f;
|
float castTimer = 0f;
|
||||||
while(castTimer < 2.0f)
|
while(castTimer < AswidConfig.EclipseCastTime.Value)
|
||||||
{
|
{
|
||||||
// Force root player physically if possible without breaking their animator
|
// Force root player physically if possible without breaking their animator
|
||||||
HarmonyLib.Traverse.Create(Player.m_localPlayer).Method("SetRun", false).GetValue();
|
HarmonyLib.Traverse.Create(Player.m_localPlayer).Method("SetRun", false).GetValue();
|
||||||
|
|
@ -810,7 +810,7 @@ namespace RacesOfValheim
|
||||||
HarmonyLib.Traverse.Create(EnvMan.instance).Field("m_debugTimeOfDay").SetValue(0.5f); // Midnight
|
HarmonyLib.Traverse.Create(EnvMan.instance).Field("m_debugTimeOfDay").SetValue(0.5f); // Midnight
|
||||||
}
|
}
|
||||||
|
|
||||||
yield return new WaitForSeconds(60f);
|
yield return new WaitForSeconds(AswidConfig.EclipseDuration.Value);
|
||||||
|
|
||||||
// Revert to server time
|
// Revert to server time
|
||||||
if (EnvMan.instance != null)
|
if (EnvMan.instance != null)
|
||||||
|
|
@ -831,7 +831,7 @@ namespace RacesOfValheim
|
||||||
private void HandleVampiricAura()
|
private void HandleVampiricAura()
|
||||||
{
|
{
|
||||||
damageTickTimer += Time.deltaTime;
|
damageTickTimer += Time.deltaTime;
|
||||||
if (damageTickTimer < 0.25f) return;
|
if (damageTickTimer < AswidConfig.AuraTickInterval.Value) return;
|
||||||
|
|
||||||
damageTickTimer = 0f;
|
damageTickTimer = 0f;
|
||||||
PerformLifeDrain();
|
PerformLifeDrain();
|
||||||
|
|
@ -854,8 +854,8 @@ namespace RacesOfValheim
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Vector3 center = Player.m_localPlayer.transform.position;
|
Vector3 center = Player.m_localPlayer.transform.position;
|
||||||
float radius = 3f;
|
float radius = AswidConfig.AuraRadiusDay.Value;
|
||||||
if (EnvMan.instance != null && EnvMan.IsNight()) radius = 6f;
|
if (EnvMan.instance != null && EnvMan.IsNight()) radius = AswidConfig.AuraRadiusNight.Value;
|
||||||
|
|
||||||
int layerMask = LayerMask.GetMask("character", "character_net", "character_ghost");
|
int layerMask = LayerMask.GetMask("character", "character_net", "character_ghost");
|
||||||
var colliders = Physics.OverlapSphere(center, radius, layerMask);
|
var colliders = Physics.OverlapSphere(center, radius, layerMask);
|
||||||
|
|
@ -873,12 +873,12 @@ namespace RacesOfValheim
|
||||||
float maxHp = c.GetMaxHealth();
|
float maxHp = c.GetMaxHealth();
|
||||||
float currentHp = c.GetHealth();
|
float currentHp = c.GetHealth();
|
||||||
|
|
||||||
float baseDamage = 1.0f;
|
float baseDamage = AswidConfig.AuraBaseDamage.Value;
|
||||||
float bloodMagicFactor = Player.m_localPlayer.GetSkillFactor(Skills.SkillType.BloodMagic);
|
float bloodMagicFactor = Player.m_localPlayer.GetSkillFactor(Skills.SkillType.BloodMagic);
|
||||||
// Lo scaling aggiunge un massimo di +5.0 danni (al livello 100), indipendentemente dal danno base
|
// Lo scaling aggiunge un massimo di +AuraBloodMagicScaling danni (al livello 100), indipendentemente dal danno base
|
||||||
float totalDamage = (baseDamage + bloodMagicFactor * 5f) * GetAuraFormMultiplier();
|
float totalDamage = (baseDamage + bloodMagicFactor * AswidConfig.AuraBloodMagicScaling.Value) * GetAuraFormMultiplier();
|
||||||
|
|
||||||
if (currentHp > 0 && currentHp <= maxHp * 0.20f && !c.IsBoss())
|
if (currentHp > 0 && currentHp <= maxHp * AswidConfig.AuraExecuteThreshold.Value && !c.IsBoss())
|
||||||
{
|
{
|
||||||
totalDamage = currentHp * 2f; // Lethal damage for execute
|
totalDamage = currentHp * 2f; // Lethal damage for execute
|
||||||
TryConsumeMob(c, maxHp, true); // Automatically devour when executed, bypassing cooldown
|
TryConsumeMob(c, maxHp, true); // Automatically devour when executed, bypassing cooldown
|
||||||
|
|
@ -913,7 +913,7 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
if (!DevourEnabled) return;
|
if (!DevourEnabled) return;
|
||||||
|
|
||||||
if (!bypassCooldown && Time.time - lastConsumeTime < 5f)
|
if (!bypassCooldown && Time.time - lastConsumeTime < AswidConfig.DevourCooldown.Value)
|
||||||
{
|
{
|
||||||
return; // Cooldown active
|
return; // Cooldown active
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,12 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
m_fallDamageModifier = -1f; // No fall damage
|
m_fallDamageModifier = -1f; // No fall damage
|
||||||
|
|
||||||
float multiplier = (EnvMan.instance != null && EnvMan.IsNight()) ? 2f : 1f;
|
float multiplier = (EnvMan.instance != null && EnvMan.IsNight()) ? AswidConfig.NightMultiplier.Value : 1f;
|
||||||
|
|
||||||
m_speedModifier = 0.01f * state * multiplier; // +3% speed per stage (*2 at night)
|
m_speedModifier = AswidConfig.SpeedBonusPerState.Value * state * multiplier;
|
||||||
|
|
||||||
// For jump, Valheim SE_Stats typically adds the y value to 1
|
// For jump, Valheim SE_Stats typically adds the y value to 1
|
||||||
m_jumpModifier = new Vector3(0f, 0.01f * state * multiplier, 0f);
|
m_jumpModifier = new Vector3(0f, AswidConfig.SpeedBonusPerState.Value * state * multiplier, 0f);
|
||||||
|
|
||||||
if (state >= 5)
|
if (state >= 5)
|
||||||
{
|
{
|
||||||
|
|
@ -47,7 +47,7 @@ namespace RacesOfValheim
|
||||||
var rules = AswidProgression.GetRules(state);
|
var rules = AswidProgression.GetRules(state);
|
||||||
if (rules != null && rules.HasSurtlingForm)
|
if (rules != null && rules.HasSurtlingForm)
|
||||||
{
|
{
|
||||||
hitData.m_damage.m_damage += 30f;
|
hitData.m_damage.m_damage += AswidConfig.SurtlingFormDamageBonus.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ namespace RacesOfValheim
|
||||||
if (enslaveTime > 0)
|
if (enslaveTime > 0)
|
||||||
{
|
{
|
||||||
DateTime time = new DateTime(enslaveTime);
|
DateTime time = new DateTime(enslaveTime);
|
||||||
if ((DateTime.Now - time).TotalSeconds >= 60.0)
|
if ((DateTime.Now - time).TotalSeconds >= AswidConfig.ThrallLifetime.Value)
|
||||||
{
|
{
|
||||||
// Time's up! Kill the thrall.
|
// Time's up! Kill the thrall.
|
||||||
HitData hit = new HitData();
|
HitData hit = new HitData();
|
||||||
|
|
|
||||||
37
JotunnModStub/ConfigurationManagerAttributes.cs
Normal file
37
JotunnModStub/ConfigurationManagerAttributes.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
using System;
|
||||||
|
using BepInEx.Configuration;
|
||||||
|
|
||||||
|
namespace RacesOfValheim
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Duck-typed by Configuration Manager (matched by field name via reflection, not by type),
|
||||||
|
/// so nothing here needs a reference to ConfigurationManager.dll and the mod works with or
|
||||||
|
/// without that plugin installed - see CONFIGURATION-MANAGER-HOWTO.md, "Overriding default
|
||||||
|
/// Configuration Manager behavior". Kept internal, not public, so this shape can never collide
|
||||||
|
/// with another mod's copy of the same trick.
|
||||||
|
///
|
||||||
|
/// Only the fields RacesOfValheim actually sets (Order, CustomDrawer, HideDefaultButton,
|
||||||
|
/// ReadOnly) need to be correct; the rest of Configuration Manager's documented set is kept
|
||||||
|
/// alongside them so future config additions do not need a second copy of this file.
|
||||||
|
/// </summary>
|
||||||
|
internal sealed class ConfigurationManagerAttributes
|
||||||
|
{
|
||||||
|
// Most of these are read by Configuration Manager itself via reflection and are never
|
||||||
|
// assigned from our own code, which is exactly what CS0649 is warning about here.
|
||||||
|
#pragma warning disable 0649
|
||||||
|
public Action<ConfigEntryBase> CustomDrawer;
|
||||||
|
public bool? Browsable;
|
||||||
|
public string Category;
|
||||||
|
public object DefaultValue;
|
||||||
|
public bool? HideDefaultButton;
|
||||||
|
public bool? HideSettingName;
|
||||||
|
public string Description;
|
||||||
|
public string DispName;
|
||||||
|
public int? Order;
|
||||||
|
public bool? ReadOnly;
|
||||||
|
public bool? IsAdvanced;
|
||||||
|
public Func<object, string> ObjToStr;
|
||||||
|
public Func<string, object> StrToObj;
|
||||||
|
#pragma warning restore 0649
|
||||||
|
}
|
||||||
|
}
|
||||||
116
JotunnModStub/Draugh/DraughConfig.cs
Normal file
116
JotunnModStub/Draugh/DraughConfig.cs
Normal file
|
|
@ -0,0 +1,116 @@
|
||||||
|
using BepInEx.Configuration;
|
||||||
|
|
||||||
|
namespace RacesOfValheim
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Every tunable number behind the Draugh's abilities, bound as BepInEx ConfigEntry so they
|
||||||
|
/// show up in Configuration Manager without touching code - see
|
||||||
|
/// CONFIGURATION-MANAGER-HOWTO.md. Bound once, from RacesOfValheim.Awake(). One section per
|
||||||
|
/// topic (matches SkadiConfig/AswidConfig's layout) rather than one shared section, so each
|
||||||
|
/// shows up as its own entry in Configuration Manager's category list.
|
||||||
|
///
|
||||||
|
/// No keybinds here: every Draugh ability triggers automatically off a game event (a parry, a
|
||||||
|
/// hit taken, a hit landed, death) rather than a key press, unlike Skadi or Aswid.
|
||||||
|
///
|
||||||
|
/// Tier-gate thresholds (which progression state unlocks each ability) are left as-is, same
|
||||||
|
/// boundary drawn for Skadi's progression table - these are a differently-shaped piece of
|
||||||
|
/// config (per-tier unlock tables, not flat values).
|
||||||
|
/// </summary>
|
||||||
|
public static class DraughConfig
|
||||||
|
{
|
||||||
|
// ─── Passive combat (always active) ───────────────────────────────────
|
||||||
|
public static ConfigEntry<float> PhysicalResistMultiplier;
|
||||||
|
public static ConfigEntry<float> FireSpiritWeaknessMultiplier;
|
||||||
|
|
||||||
|
// ─── Sunken Menace (tier 2+: Wet heals instead of hurts) ─────────────────
|
||||||
|
public static ConfigEntry<float> WetHealthRegenMultiplier;
|
||||||
|
|
||||||
|
// ─── Rotting Edge (tier 3+: poison on hit, poison splash on parry) ──────
|
||||||
|
public static ConfigEntry<float> PoisonOnHitPercent;
|
||||||
|
public static ConfigEntry<float> ParryWindow;
|
||||||
|
public static ConfigEntry<float> PoisonSplashDamage;
|
||||||
|
|
||||||
|
// ─── Undead Fortitude (tier 4+: crit on staggered, death aura) ──────────
|
||||||
|
public static ConfigEntry<float> StaggerCritMultiplier;
|
||||||
|
public static ConfigEntry<float> DeathAuraRadius;
|
||||||
|
|
||||||
|
// ─── North Wind (tier 5+: AoE frost on parry, on the same cooldown) ──────
|
||||||
|
public static ConfigEntry<float> NorthWindCooldown;
|
||||||
|
public static ConfigEntry<float> NorthWindRadius;
|
||||||
|
public static ConfigEntry<float> NorthWindFrostDamage;
|
||||||
|
public static ConfigEntry<float> NorthWindPushForce;
|
||||||
|
|
||||||
|
// ─── Undying Will (tier 6+: survive death by burning Eitr) ──────────────
|
||||||
|
public static ConfigEntry<float> UndyingWillCooldown;
|
||||||
|
public static ConfigEntry<float> UndyingWillEitrDrainPerTick;
|
||||||
|
public static ConfigEntry<float> UndyingWillTickInterval;
|
||||||
|
|
||||||
|
// ─── Swarm of Terror (tier 7+: spawn friendly seeker brood on melee hits) ─
|
||||||
|
public static ConfigEntry<float> SwarmDetectionRadius;
|
||||||
|
public static ConfigEntry<float> SwarmSpawnCooldown;
|
||||||
|
public static ConfigEntry<int> SwarmSpawnCount;
|
||||||
|
public static ConfigEntry<float> SwarmBroodLifetime;
|
||||||
|
|
||||||
|
// ─── Steal Their Breath (tier 8+: cancel Undying Will death by a kill) ────
|
||||||
|
public static ConfigEntry<float> StealBreathHealPercent;
|
||||||
|
|
||||||
|
public static void Bind(ConfigFile config)
|
||||||
|
{
|
||||||
|
const string combat = "Draugh - Passive Combat";
|
||||||
|
PhysicalResistMultiplier = config.Bind(combat, "Physical Resist Multiplier", 0.8f,
|
||||||
|
new ConfigDescription("Multiplies incoming blunt/slash/pierce damage (0.8 = 20% resistance).", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
FireSpiritWeaknessMultiplier = config.Bind(combat, "Fire/Spirit Weakness Multiplier", 1.5f,
|
||||||
|
new ConfigDescription("Multiplies incoming fire/spirit damage (1.5 = 50% weaker).", new AcceptableValueRange<float>(1f, 3f)));
|
||||||
|
|
||||||
|
const string sunkenMenace = "Draugh - Sunken Menace";
|
||||||
|
WetHealthRegenMultiplier = config.Bind(sunkenMenace, "Wet Health Regen Multiplier", 1.25f,
|
||||||
|
new ConfigDescription("Health regen multiplier while Wet, tier 2+ (Wet heals instead of hurting).", new AcceptableValueRange<float>(1f, 3f)));
|
||||||
|
|
||||||
|
const string rottingEdge = "Draugh - Rotting Edge";
|
||||||
|
PoisonOnHitPercent = config.Bind(rottingEdge, "Poison On Hit Percent", 0.20f,
|
||||||
|
new ConfigDescription("Fraction of physical damage dealt added as poison, tier 3+.", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
ParryWindow = config.Bind(rottingEdge, "Parry Window", 0.25f,
|
||||||
|
new ConfigDescription("Seconds after a block still counts as a parry for Poison Splash/North Wind.", new AcceptableValueRange<float>(0.05f, 1f)));
|
||||||
|
PoisonSplashDamage = config.Bind(rottingEdge, "Poison Splash Damage", 40f,
|
||||||
|
new ConfigDescription("Flat poison damage dealt to whoever you parry, tier 3+.", new AcceptableValueRange<float>(0f, 200f)));
|
||||||
|
|
||||||
|
const string fortitude = "Draugh - Undead Fortitude";
|
||||||
|
StaggerCritMultiplier = config.Bind(fortitude, "Stagger Crit Multiplier", 1.30f,
|
||||||
|
new ConfigDescription("Multiplies physical damage dealt to staggered enemies, tier 4+.", new AcceptableValueRange<float>(1f, 3f)));
|
||||||
|
DeathAuraRadius = config.Bind(fortitude, "Death Aura Radius", 100f,
|
||||||
|
new ConfigDescription("Meters within which an ally's death drops Human Meat for you, tier 4+.", new AcceptableValueRange<float>(10f, 300f)));
|
||||||
|
|
||||||
|
const string northWind = "Draugh - North Wind";
|
||||||
|
NorthWindCooldown = config.Bind(northWind, "Cooldown", 20f,
|
||||||
|
new ConfigDescription("Seconds between North Wind triggers, tier 5+.", new AcceptableValueRange<float>(0f, 120f)));
|
||||||
|
NorthWindRadius = config.Bind(northWind, "Radius", 8f,
|
||||||
|
new ConfigDescription("Meters from you that North Wind damages.", new AcceptableValueRange<float>(1f, 30f)));
|
||||||
|
NorthWindFrostDamage = config.Bind(northWind, "Frost Damage", 50f,
|
||||||
|
new ConfigDescription("Flat frost damage dealt to everything in range.", new AcceptableValueRange<float>(0f, 200f)));
|
||||||
|
NorthWindPushForce = config.Bind(northWind, "Push Force", 20f,
|
||||||
|
new ConfigDescription("Knockback applied to everything hit.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
|
||||||
|
const string undyingWill = "Draugh - Undying Will";
|
||||||
|
UndyingWillCooldown = config.Bind(undyingWill, "Cooldown", 600f,
|
||||||
|
new ConfigDescription("Seconds between Undying Will triggers, tier 6+.", new AcceptableValueRange<float>(0f, 3600f)));
|
||||||
|
UndyingWillEitrDrainPerTick = config.Bind(undyingWill, "Eitr Drain Per Tick", 2f,
|
||||||
|
new ConfigDescription("Eitr spent per tick while surviving on borrowed time.", new AcceptableValueRange<float>(0f, 20f)));
|
||||||
|
UndyingWillTickInterval = config.Bind(undyingWill, "Tick Interval", 0.2f,
|
||||||
|
new ConfigDescription("Seconds between Eitr drain ticks.", new AcceptableValueRange<float>(0.05f, 2f)));
|
||||||
|
|
||||||
|
const string swarm = "Draugh - Swarm Of Terror";
|
||||||
|
SwarmDetectionRadius = config.Bind(swarm, "Melee Detection Radius", 5f,
|
||||||
|
new ConfigDescription("Meters within which a hit taken counts as melee and can trigger a spawn, tier 7+.", new AcceptableValueRange<float>(1f, 20f)));
|
||||||
|
SwarmSpawnCooldown = config.Bind(swarm, "Spawn Cooldown", 10f,
|
||||||
|
new ConfigDescription("Seconds between spawns.", new AcceptableValueRange<float>(0f, 60f)));
|
||||||
|
SwarmSpawnCount = config.Bind(swarm, "Spawn Count", 2,
|
||||||
|
new ConfigDescription("Friendly Seeker Broodlings spawned per trigger.", new AcceptableValueRange<int>(1, 10)));
|
||||||
|
SwarmBroodLifetime = config.Bind(swarm, "Brood Lifetime", 9.5f,
|
||||||
|
new ConfigDescription("Seconds a spawned broodling survives before it dies on its own.", new AcceptableValueRange<float>(1f, 60f)));
|
||||||
|
|
||||||
|
const string stealBreath = "Draugh - Steal Their Breath";
|
||||||
|
StealBreathHealPercent = config.Bind(stealBreath, "Heal Percent", 0.25f,
|
||||||
|
new ConfigDescription("Fraction of max health healed when a kill cancels an in-progress Undying Will death, tier 8+.", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -120,14 +120,14 @@ namespace RacesOfValheim
|
||||||
if (!DraughRace.IsDraugh()) return;
|
if (!DraughRace.IsDraugh()) return;
|
||||||
|
|
||||||
// Apply specific damage modifiers for Draugh
|
// Apply specific damage modifiers for Draugh
|
||||||
// -20% damage received from slash, pierce, blunt
|
float physResist = DraughConfig.PhysicalResistMultiplier.Value;
|
||||||
hit.m_damage.m_blunt *= 0.8f;
|
hit.m_damage.m_blunt *= physResist;
|
||||||
hit.m_damage.m_slash *= 0.8f;
|
hit.m_damage.m_slash *= physResist;
|
||||||
hit.m_damage.m_pierce *= 0.8f;
|
hit.m_damage.m_pierce *= physResist;
|
||||||
|
|
||||||
// +50% damage received from fire, spirit
|
float fireSpiritWeakness = DraughConfig.FireSpiritWeaknessMultiplier.Value;
|
||||||
hit.m_damage.m_fire *= 1.5f;
|
hit.m_damage.m_fire *= fireSpiritWeakness;
|
||||||
hit.m_damage.m_spirit *= 1.5f;
|
hit.m_damage.m_spirit *= fireSpiritWeakness;
|
||||||
|
|
||||||
// Stage 4: Undead Fortitude (Poison Immunity)
|
// Stage 4: Undead Fortitude (Poison Immunity)
|
||||||
if (BossProgressionManager.GetCurrentProgressionState() >= 4)
|
if (BossProgressionManager.GetCurrentProgressionState() >= 4)
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace RacesOfValheim
|
||||||
if (BossProgressionManager.GetCurrentProgressionState() >= 2)
|
if (BossProgressionManager.GetCurrentProgressionState() >= 2)
|
||||||
{
|
{
|
||||||
// Invert the Wet debuff to actually heal the Draugh
|
// Invert the Wet debuff to actually heal the Draugh
|
||||||
__instance.m_healthRegenMultiplier = 1.25f; // +25% health regen
|
__instance.m_healthRegenMultiplier = DraughConfig.WetHealthRegenMultiplier.Value;
|
||||||
__instance.m_staminaRegenMultiplier = 1f; // No stamina penalty
|
__instance.m_staminaRegenMultiplier = 1f; // No stamina penalty
|
||||||
__instance.m_tooltip = "The water restores your rotten flesh. Health regeneration increased.";
|
__instance.m_tooltip = "The water restores your rotten flesh. Health regeneration increased.";
|
||||||
}
|
}
|
||||||
|
|
@ -47,20 +47,21 @@ namespace RacesOfValheim
|
||||||
float physDamage = hit.m_damage.m_blunt + hit.m_damage.m_slash + hit.m_damage.m_pierce + hit.m_damage.m_chop;
|
float physDamage = hit.m_damage.m_blunt + hit.m_damage.m_slash + hit.m_damage.m_pierce + hit.m_damage.m_chop;
|
||||||
if (physDamage > 0f && hit.m_skill != Skills.SkillType.BloodMagic && hit.m_skill != Skills.SkillType.ElementalMagic)
|
if (physDamage > 0f && hit.m_skill != Skills.SkillType.BloodMagic && hit.m_skill != Skills.SkillType.ElementalMagic)
|
||||||
{
|
{
|
||||||
// Add poison damage based on the physical damage (e.g., 20% of physical damage as poison DoT)
|
// Add poison damage based on the physical damage
|
||||||
hit.m_damage.m_poison += physDamage * 0.20f;
|
hit.m_damage.m_poison += physDamage * DraughConfig.PoisonOnHitPercent.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BossProgressionManager.GetCurrentProgressionState() >= 4)
|
if (BossProgressionManager.GetCurrentProgressionState() >= 4)
|
||||||
{
|
{
|
||||||
// Stage 4: Undead Fortitude (+30% crit damage on staggered enemies)
|
// Stage 4: Undead Fortitude (crit damage on staggered enemies)
|
||||||
if (__instance.IsStaggering())
|
if (__instance.IsStaggering())
|
||||||
{
|
{
|
||||||
hit.m_damage.m_blunt *= 1.30f;
|
float critMult = DraughConfig.StaggerCritMultiplier.Value;
|
||||||
hit.m_damage.m_slash *= 1.30f;
|
hit.m_damage.m_blunt *= critMult;
|
||||||
hit.m_damage.m_pierce *= 1.30f;
|
hit.m_damage.m_slash *= critMult;
|
||||||
hit.m_damage.m_chop *= 1.30f;
|
hit.m_damage.m_pierce *= critMult;
|
||||||
|
hit.m_damage.m_chop *= critMult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -84,13 +85,13 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
// Check if it was a parry.
|
// Check if it was a parry.
|
||||||
float blockTimer = Traverse.Create(__instance).Field("m_blockTimer").GetValue<float>();
|
float blockTimer = Traverse.Create(__instance).Field("m_blockTimer").GetValue<float>();
|
||||||
float parryTime = 0.25f; // Default Valheim parry window
|
float parryTime = DraughConfig.ParryWindow.Value;
|
||||||
|
|
||||||
if (blockTimer != -1f && blockTimer <= parryTime)
|
if (blockTimer != -1f && blockTimer <= parryTime)
|
||||||
{
|
{
|
||||||
// Stage 3: Poison Splash
|
// Stage 3: Poison Splash
|
||||||
HitData poisonSplash = new HitData();
|
HitData poisonSplash = new HitData();
|
||||||
poisonSplash.m_damage.m_poison = 40f; // Flat base poison splash
|
poisonSplash.m_damage.m_poison = DraughConfig.PoisonSplashDamage.Value;
|
||||||
poisonSplash.m_point = attacker.GetCenterPoint();
|
poisonSplash.m_point = attacker.GetCenterPoint();
|
||||||
poisonSplash.SetAttacker(__instance);
|
poisonSplash.SetAttacker(__instance);
|
||||||
poisonSplash.m_dir = (attacker.GetCenterPoint() - __instance.GetCenterPoint()).normalized;
|
poisonSplash.m_dir = (attacker.GetCenterPoint() - __instance.GetCenterPoint()).normalized;
|
||||||
|
|
@ -103,7 +104,7 @@ namespace RacesOfValheim
|
||||||
// Stage 5: North Wind (AoE Frost)
|
// Stage 5: North Wind (AoE Frost)
|
||||||
if (state >= 5)
|
if (state >= 5)
|
||||||
{
|
{
|
||||||
if (Time.time - lastNorthWindTime >= 20f)
|
if (Time.time - lastNorthWindTime >= DraughConfig.NorthWindCooldown.Value)
|
||||||
{
|
{
|
||||||
lastNorthWindTime = Time.time;
|
lastNorthWindTime = Time.time;
|
||||||
|
|
||||||
|
|
@ -115,20 +116,21 @@ namespace RacesOfValheim
|
||||||
UnityEngine.Object.Instantiate(iceHit, __instance.transform.position, Quaternion.identity);
|
UnityEngine.Object.Instantiate(iceHit, __instance.transform.position, Quaternion.identity);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find all characters within 8 meters
|
// Find all characters within range
|
||||||
|
float northWindRadius = DraughConfig.NorthWindRadius.Value;
|
||||||
List<Character> allCharacters = Character.GetAllCharacters();
|
List<Character> allCharacters = Character.GetAllCharacters();
|
||||||
foreach (Character ch in allCharacters)
|
foreach (Character ch in allCharacters)
|
||||||
{
|
{
|
||||||
if (ch == null || ch == __instance || ch.IsPlayer() || ch.IsDead()) continue;
|
if (ch == null || ch == __instance || ch.IsPlayer() || ch.IsDead()) continue;
|
||||||
|
|
||||||
if (Vector3.Distance(__instance.transform.position, ch.transform.position) <= 8f)
|
if (Vector3.Distance(__instance.transform.position, ch.transform.position) <= northWindRadius)
|
||||||
{
|
{
|
||||||
HitData northWind = new HitData();
|
HitData northWind = new HitData();
|
||||||
northWind.m_damage.m_frost = 50f;
|
northWind.m_damage.m_frost = DraughConfig.NorthWindFrostDamage.Value;
|
||||||
northWind.m_point = ch.GetCenterPoint();
|
northWind.m_point = ch.GetCenterPoint();
|
||||||
northWind.SetAttacker(__instance);
|
northWind.SetAttacker(__instance);
|
||||||
northWind.m_dir = (ch.GetCenterPoint() - __instance.GetCenterPoint()).normalized;
|
northWind.m_dir = (ch.GetCenterPoint() - __instance.GetCenterPoint()).normalized;
|
||||||
northWind.m_pushForce = 20f;
|
northWind.m_pushForce = DraughConfig.NorthWindPushForce.Value;
|
||||||
|
|
||||||
ch.ApplyDamage(northWind, true, false);
|
ch.ApplyDamage(northWind, true, false);
|
||||||
}
|
}
|
||||||
|
|
@ -177,7 +179,7 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
if (p.m_customData != null && p.m_customData.TryGetValue("Race", out string race) && race == "Draugh")
|
if (p.m_customData != null && p.m_customData.TryGetValue("Race", out string race) && race == "Draugh")
|
||||||
{
|
{
|
||||||
if (Vector3.Distance(__instance.transform.position, p.transform.position) <= 100f)
|
if (Vector3.Distance(__instance.transform.position, p.transform.position) <= DraughConfig.DeathAuraRadius.Value)
|
||||||
{
|
{
|
||||||
draughNearby = true;
|
draughNearby = true;
|
||||||
break;
|
break;
|
||||||
|
|
@ -229,7 +231,7 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
|
|
||||||
float currentEitr = __instance.GetEitr();
|
float currentEitr = __instance.GetEitr();
|
||||||
if (currentEitr > 0f && Time.time - DraughRace.lastUndyingWillTime >= 600f) // 10 minutes
|
if (currentEitr > 0f && Time.time - DraughRace.lastUndyingWillTime >= DraughConfig.UndyingWillCooldown.Value)
|
||||||
{
|
{
|
||||||
// Trigger Undying Will!
|
// Trigger Undying Will!
|
||||||
DraughRace.lastUndyingWillTime = Time.time;
|
DraughRace.lastUndyingWillTime = Time.time;
|
||||||
|
|
@ -279,9 +281,9 @@ namespace RacesOfValheim
|
||||||
if (hit == null || hit.GetAttacker() == null || hit.m_damage.GetTotalDamage() <= 0f) return;
|
if (hit == null || hit.GetAttacker() == null || hit.m_damage.GetTotalDamage() <= 0f) return;
|
||||||
|
|
||||||
// Melee check via distance
|
// Melee check via distance
|
||||||
if (Vector3.Distance(hit.GetAttacker().transform.position, __instance.transform.position) <= 5f)
|
if (Vector3.Distance(hit.GetAttacker().transform.position, __instance.transform.position) <= DraughConfig.SwarmDetectionRadius.Value)
|
||||||
{
|
{
|
||||||
if (Time.time - DraughRace.lastSeekerSpawnTime >= 10f)
|
if (Time.time - DraughRace.lastSeekerSpawnTime >= DraughConfig.SwarmSpawnCooldown.Value)
|
||||||
{
|
{
|
||||||
DraughRace.lastSeekerSpawnTime = Time.time;
|
DraughRace.lastSeekerSpawnTime = Time.time;
|
||||||
|
|
||||||
|
|
@ -295,7 +297,7 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
Player.m_localPlayer.Message(MessageHud.MessageType.Center, "Swarm of Terror!");
|
Player.m_localPlayer.Message(MessageHud.MessageType.Center, "Swarm of Terror!");
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < DraughConfig.SwarmSpawnCount.Value; i++)
|
||||||
{
|
{
|
||||||
Vector3 spawnPos = __instance.transform.position + __instance.transform.forward * 1f + UnityEngine.Random.insideUnitSphere * 1.5f;
|
Vector3 spawnPos = __instance.transform.position + __instance.transform.forward * 1f + UnityEngine.Random.insideUnitSphere * 1.5f;
|
||||||
spawnPos.y = __instance.transform.position.y;
|
spawnPos.y = __instance.transform.position.y;
|
||||||
|
|
@ -313,8 +315,7 @@ namespace RacesOfValheim
|
||||||
UnityEngine.Object.Destroy(drop);
|
UnityEngine.Object.Destroy(drop);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Kill after 9.5 seconds
|
DraughRace.Instance.StartCoroutine(DraughRace.Instance.KillBroodAfterTime(c, DraughConfig.SwarmBroodLifetime.Value));
|
||||||
DraughRace.Instance.StartCoroutine(DraughRace.Instance.KillBroodAfterTime(c, 9.5f));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -335,7 +336,7 @@ namespace RacesOfValheim
|
||||||
// Steal Their Breath triggered!
|
// Steal Their Breath triggered!
|
||||||
DraughRace.isUndying = false; // Break the routine loop
|
DraughRace.isUndying = false; // Break the routine loop
|
||||||
|
|
||||||
float healAmount = Player.m_localPlayer.GetMaxHealth() * 0.25f;
|
float healAmount = Player.m_localPlayer.GetMaxHealth() * DraughConfig.StealBreathHealPercent.Value;
|
||||||
Player.m_localPlayer.Heal(healAmount);
|
Player.m_localPlayer.Heal(healAmount);
|
||||||
|
|
||||||
Player.m_localPlayer.Message(MessageHud.MessageType.Center, "Steal Their Breath! Death is denied.");
|
Player.m_localPlayer.Message(MessageHud.MessageType.Center, "Steal Their Breath! Death is denied.");
|
||||||
|
|
|
||||||
|
|
@ -153,10 +153,9 @@ namespace RacesOfValheim
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Drain 2 Eitr per tick (5 ticks per second = 10 eitr/sec)
|
p.UseEitr(DraughConfig.UndyingWillEitrDrainPerTick.Value);
|
||||||
p.UseEitr(2f);
|
|
||||||
|
|
||||||
yield return new WaitForSeconds(0.2f);
|
yield return new WaitForSeconds(DraughConfig.UndyingWillTickInterval.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore visuals
|
// Restore visuals
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,12 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
DvergarProgression.DvergarRules rules = DvergarProgression.GetRules(state);
|
DvergarProgression.DvergarRules rules = DvergarProgression.GetRules(state);
|
||||||
|
|
||||||
if (rules.RunicPing && Input.GetKeyDown(DvergarConfig.RunicPingKey))
|
if (rules.RunicPing && DvergarConfigManagement.RunicPingKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
TryRunicPing(player);
|
TryRunicPing(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rules.RunicOvercharge && Input.GetKeyDown(DvergarConfig.RunicOverchargeKey))
|
if (rules.RunicOvercharge && DvergarConfigManagement.RunicOverchargeKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
TryRunicOvercharge(player);
|
TryRunicOvercharge(player);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,9 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
// ─── Health malus ────────────────────────────────────────────────────
|
// ─── Health malus ────────────────────────────────────────────────────
|
||||||
// Indexed by progression state; index 0 is unused so the state number indexes directly.
|
// Indexed by progression state; index 0 is unused so the state number indexes directly.
|
||||||
// Base -10, growing to -20 once The Queen falls.
|
// Base -10, growing to -20 once The Queen falls. Left as a plain per-tier table, same
|
||||||
|
// boundary drawn everywhere else in this mod (Skadi's progression table included) -
|
||||||
|
// not exposed through Configuration Manager.
|
||||||
public static readonly float[] HealthMalusByState =
|
public static readonly float[] HealthMalusByState =
|
||||||
{
|
{
|
||||||
0f, // (unused)
|
0f, // (unused)
|
||||||
|
|
@ -206,7 +208,10 @@ namespace RacesOfValheim
|
||||||
};
|
};
|
||||||
|
|
||||||
// A Dvergar must never be reduced below this, however the malus and food line up.
|
// A Dvergar must never be reduced below this, however the malus and food line up.
|
||||||
public static readonly float MinMaxHealth = 5f;
|
// Forwards to DvergarConfigManagement (BepInEx ConfigEntry) so every existing call site
|
||||||
|
// keeps reading DvergarConfig.MinMaxHealth unchanged - see that class for why this one
|
||||||
|
// field, and not the rest of this file, is configurable.
|
||||||
|
public static float MinMaxHealth => DvergarConfigManagement.MinMaxHealth.Value;
|
||||||
|
|
||||||
// ─── Elemental affinity ──────────────────────────────────────────────
|
// ─── Elemental affinity ──────────────────────────────────────────────
|
||||||
// Runes in the blood: every blow the Dvergar lands carries lightning.
|
// Runes in the blood: every blow the Dvergar lands carries lightning.
|
||||||
|
|
@ -215,21 +220,28 @@ namespace RacesOfValheim
|
||||||
// growing by a flat step per progression state, so +2 at Base through +16 after Fader -
|
// growing by a flat step per progression state, so +2 at Base through +16 after Fader -
|
||||||
// with lightning in place of frost. SkadiDamagePatch is the reference; like it, this
|
// with lightning in place of frost. SkadiDamagePatch is the reference; like it, this
|
||||||
// applies to every blow the player lands, not only melee.
|
// applies to every blow the player lands, not only melee.
|
||||||
public static readonly float ElementalDamagePerState = 2f;
|
public static float ElementalDamagePerState => DvergarConfigManagement.ElementalDamagePerState.Value;
|
||||||
|
|
||||||
public static readonly HitData.DamageType ElementalDamageType = HitData.DamageType.Lightning;
|
public static readonly HitData.DamageType ElementalDamageType = HitData.DamageType.Lightning;
|
||||||
|
|
||||||
// ─── Weapon affinity ─────────────────────────────────────────────────
|
// ─── Weapon affinity ─────────────────────────────────────────────────
|
||||||
// Bonus damage plus a stamina discount on the attack. Neither scales with the tier - a
|
// Bonus damage plus a stamina discount on the attack. Neither scales with the tier - a
|
||||||
// tier only ever adds a new weapon to the list - and skill XP is deliberately untouched.
|
// tier only ever adds a new weapon to the list - and skill XP is deliberately untouched.
|
||||||
|
//
|
||||||
|
// DamagePercent and StaminaPercent below are fallback shape values only: identical across
|
||||||
|
// every weapon today, and DvergarProgression.GetRules overrides both with
|
||||||
|
// DvergarConfigManagement's live (and configurable) values before handing rules out - see
|
||||||
|
// the comment there. FlatDamage and StaminaFlat stay literal zero-and-unconfigured: both
|
||||||
|
// are currently inert placeholders (FlatDamage's whole effect is gated behind
|
||||||
|
// `if (affinity.FlatDamage > 0f)` in DvergarPatches, which never fires at zero).
|
||||||
public struct WeaponAffinity
|
public struct WeaponAffinity
|
||||||
{
|
{
|
||||||
public Skills.SkillType Skill;
|
public Skills.SkillType Skill;
|
||||||
public int UnlockState;
|
public int UnlockState;
|
||||||
public HitData.DamageType FlatDamageType; // channel the flat bonus lands on
|
public HitData.DamageType FlatDamageType; // channel the flat bonus lands on
|
||||||
public float FlatDamage; // TODO
|
public float FlatDamage; // TODO
|
||||||
public float DamagePercent; // TODO, share of physical damage added
|
public float DamagePercent; // fallback shape only, see above
|
||||||
public float StaminaPercent; // TODO, share of attack stamina refunded
|
public float StaminaPercent; // fallback shape only, see above
|
||||||
public float StaminaFlat; // TODO, flat stamina refunded
|
public float StaminaFlat; // TODO, flat stamina refunded
|
||||||
public string DisplayName;
|
public string DisplayName;
|
||||||
}
|
}
|
||||||
|
|
@ -275,13 +287,14 @@ namespace RacesOfValheim
|
||||||
public const int MiningAffinityState = 2;
|
public const int MiningAffinityState = 2;
|
||||||
|
|
||||||
// Faster mining is modelled as extra pickaxe damage per swing rather than a swing-rate
|
// Faster mining is modelled as extra pickaxe damage per swing rather than a swing-rate
|
||||||
// change: rock HP is what actually gates how long a vein takes.
|
// change: rock HP is what actually gates how long a vein takes. Forward to
|
||||||
public static readonly float MiningDamageMultiplier = 1.20f; // TODO: 20% faster?
|
// DvergarConfigManagement (BepInEx ConfigEntry) - see that class.
|
||||||
public static readonly float MiningStaminaPercent = 0.40f; // TODO: or 40% less stamina?
|
public static float MiningDamageMultiplier => DvergarConfigManagement.MiningDamageMultiplier.Value;
|
||||||
|
public static float MiningStaminaPercent => DvergarConfigManagement.MiningStaminaPercent.Value;
|
||||||
|
|
||||||
// Chance for a mined vein to yield an extra unit of ore. 0 disables the yield half of
|
// Chance for a mined vein to yield an extra unit of ore. 0 disables the yield half of
|
||||||
// the affinity and leaves it purely a speed/stamina perk.
|
// the affinity and leaves it purely a speed/stamina perk.
|
||||||
public static readonly float MiningExtraDropChance = 0.25f; // TODO
|
public static float MiningExtraDropChance => DvergarConfigManagement.MiningExtraDropChance.Value;
|
||||||
|
|
||||||
// Matched against the drop prefab name, lowercased, by Contains.
|
// Matched against the drop prefab name, lowercased, by Contains.
|
||||||
public static readonly string[] OreDropNames =
|
public static readonly string[] OreDropNames =
|
||||||
|
|
@ -344,18 +357,21 @@ namespace RacesOfValheim
|
||||||
};
|
};
|
||||||
|
|
||||||
// ─── Runic Ping (Yagluth) ────────────────────────────────────────────
|
// ─── Runic Ping (Yagluth) ────────────────────────────────────────────
|
||||||
public const int RunicPingState = 6;
|
// The keybind used to live here as a KeyCode const; it is now DvergarConfigManagement's
|
||||||
public const KeyCode RunicPingKey = KeyCode.G;
|
// RunicPingKey (a rebindable KeyboardShortcut), read directly by DvergarAbilities.
|
||||||
|
public const int RunicPingState = 6;
|
||||||
|
|
||||||
public static readonly float RunicPingEitrCost = 25f; // TODO
|
// Every numeric knob below forwards to DvergarConfigManagement (BepInEx ConfigEntry) -
|
||||||
public static readonly float RunicPingRadius = 40f; // TODO
|
// see that class for why these, and not the colours, are configurable.
|
||||||
public static readonly float RunicPingDuration = 10f; // TODO
|
public static float RunicPingEitrCost => DvergarConfigManagement.RunicPingEitrCost.Value;
|
||||||
public static readonly float RunicPingCooldown = 20f; // TODO
|
public static float RunicPingRadius => DvergarConfigManagement.RunicPingRadius.Value;
|
||||||
|
public static float RunicPingDuration => DvergarConfigManagement.RunicPingDuration.Value;
|
||||||
|
public static float RunicPingCooldown => DvergarConfigManagement.RunicPingCooldown.Value;
|
||||||
|
|
||||||
public static readonly Color RunicPingOreColor = new Color(0.4f, 0.8f, 1f);
|
public static readonly Color RunicPingOreColor = new Color(0.4f, 0.8f, 1f);
|
||||||
public static readonly Color RunicPingEnemyColor = new Color(1f, 0.35f, 0.35f);
|
public static readonly Color RunicPingEnemyColor = new Color(1f, 0.35f, 0.35f);
|
||||||
public static readonly float RunicPingLightRange = 8f;
|
public static float RunicPingLightRange => DvergarConfigManagement.RunicPingLightRange.Value;
|
||||||
public static readonly float RunicPingLightIntensity = 2f;
|
public static float RunicPingLightIntensity => DvergarConfigManagement.RunicPingLightIntensity.Value;
|
||||||
|
|
||||||
// Vein prefabs are matched on name, lowercased, by Contains - MineRock5_Copper,
|
// Vein prefabs are matched on name, lowercased, by Contains - MineRock5_Copper,
|
||||||
// silvervein, rock4_copper and friends all fall out of this list.
|
// silvervein, rock4_copper and friends all fall out of this list.
|
||||||
|
|
@ -365,13 +381,14 @@ namespace RacesOfValheim
|
||||||
};
|
};
|
||||||
|
|
||||||
// ─── Runic Overcharge (Fader) ────────────────────────────────────────
|
// ─── Runic Overcharge (Fader) ────────────────────────────────────────
|
||||||
public const int RunicOverchargeState = 8;
|
// The keybind used to live here as a KeyCode const; it is now DvergarConfigManagement's
|
||||||
public const KeyCode RunicOverchargeKey = KeyCode.H;
|
// RunicOverchargeKey (a rebindable KeyboardShortcut), read directly by DvergarAbilities.
|
||||||
|
public const int RunicOverchargeState = 8;
|
||||||
|
|
||||||
public static readonly float RunicOverchargeEitrCost = 60f; // TODO
|
public static float RunicOverchargeEitrCost => DvergarConfigManagement.RunicOverchargeEitrCost.Value;
|
||||||
public static readonly float RunicOverchargeMultiplier = 4f; // TODO, applied to physical damage
|
public static float RunicOverchargeMultiplier => DvergarConfigManagement.RunicOverchargeMultiplier.Value; // applied to physical damage
|
||||||
public static readonly float RunicOverchargeWindow = 15f; // seconds the charge is held
|
public static float RunicOverchargeWindow => DvergarConfigManagement.RunicOverchargeWindow.Value; // seconds the charge is held
|
||||||
public static readonly float RunicOverchargeCooldown = 60f; // TODO
|
public static float RunicOverchargeCooldown => DvergarConfigManagement.RunicOverchargeCooldown.Value;
|
||||||
|
|
||||||
// ─── Helpers ─────────────────────────────────────────────────────────
|
// ─── Helpers ─────────────────────────────────────────────────────────
|
||||||
/// <summary>Clamped table lookup, so a state outside 1..8 can never index out of range.</summary>
|
/// <summary>Clamped table lookup, so a state outside 1..8 can never index out of range.</summary>
|
||||||
|
|
|
||||||
111
JotunnModStub/Dvergar/DvergarConfigManagement.cs
Normal file
111
JotunnModStub/Dvergar/DvergarConfigManagement.cs
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
using UnityEngine;
|
||||||
|
using BepInEx.Configuration;
|
||||||
|
|
||||||
|
namespace RacesOfValheim
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The BepInEx-configurable slice of the Dvergar's numbers, bound as ConfigEntry so they show
|
||||||
|
/// up in Configuration Manager without touching code - see CONFIGURATION-MANAGER-HOWTO.md.
|
||||||
|
/// Bound once, from RacesOfValheim.Awake(). One section per topic (matches
|
||||||
|
/// SkadiConfig/AswidConfig/DraughConfig's layout).
|
||||||
|
///
|
||||||
|
/// Named separately from the pre-existing DvergarConfig (rather than folding into it) because
|
||||||
|
/// that class is a different kind of thing: identity constants that must never change once a
|
||||||
|
/// player has the race (RaceId, status effect names - renaming them would orphan saved
|
||||||
|
/// characters), hand-tuned cosmetic placement numbers (eye/hood position - exposing those as
|
||||||
|
/// sliders would just let someone accidentally break the model), and per-tier tables (health
|
||||||
|
/// malus, smithing/trader discounts - the same "leave alone" boundary drawn for every other
|
||||||
|
/// race's progression table). Only the genuine ability knobs - Runic Ping/Overcharge and their
|
||||||
|
/// two keybinds, mining and weapon-affinity percentages - belong here. DvergarConfig's own
|
||||||
|
/// fields for those now forward to this class (see the comments there), so every existing call
|
||||||
|
/// site kept working unchanged.
|
||||||
|
///
|
||||||
|
/// One caveat worth knowing: DvergarProgression.GetRules caches its result per progression
|
||||||
|
/// state the first time that state is reached. ElementalDamagePerState and the weapon-affinity
|
||||||
|
/// percentages below are read into that cache, so retuning them mid-session only affects tiers
|
||||||
|
/// the cache hasn't already built - a relog (or reaching a new tier) picks up the new value.
|
||||||
|
/// Runic Ping/Overcharge and mining read their config live on every use and are unaffected.
|
||||||
|
/// </summary>
|
||||||
|
public static class DvergarConfigManagement
|
||||||
|
{
|
||||||
|
// ─── Keybinds ──────────────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<KeyboardShortcut> RunicPingKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> RunicOverchargeKey;
|
||||||
|
|
||||||
|
// ─── Passive combat ──────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> ElementalDamagePerState;
|
||||||
|
public static ConfigEntry<float> MinMaxHealth;
|
||||||
|
public static ConfigEntry<float> WeaponAffinityDamagePercent;
|
||||||
|
public static ConfigEntry<float> WeaponAffinityStaminaPercent;
|
||||||
|
|
||||||
|
// ─── Mining ────────────────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> MiningDamageMultiplier;
|
||||||
|
public static ConfigEntry<float> MiningStaminaPercent;
|
||||||
|
public static ConfigEntry<float> MiningExtraDropChance;
|
||||||
|
|
||||||
|
// ─── Runic Ping (tier 6+) ─────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> RunicPingEitrCost;
|
||||||
|
public static ConfigEntry<float> RunicPingRadius;
|
||||||
|
public static ConfigEntry<float> RunicPingDuration;
|
||||||
|
public static ConfigEntry<float> RunicPingCooldown;
|
||||||
|
public static ConfigEntry<float> RunicPingLightRange;
|
||||||
|
public static ConfigEntry<float> RunicPingLightIntensity;
|
||||||
|
|
||||||
|
// ─── Runic Overcharge (tier 8) ────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> RunicOverchargeEitrCost;
|
||||||
|
public static ConfigEntry<float> RunicOverchargeMultiplier;
|
||||||
|
public static ConfigEntry<float> RunicOverchargeWindow;
|
||||||
|
public static ConfigEntry<float> RunicOverchargeCooldown;
|
||||||
|
|
||||||
|
public static void Bind(ConfigFile config)
|
||||||
|
{
|
||||||
|
const string keybinds = "Dvergar - Keybinds";
|
||||||
|
RunicPingKey = config.Bind(keybinds, "Runic Ping", new KeyboardShortcut(KeyCode.G),
|
||||||
|
new ConfigDescription("Lights up ore veins and hidden enemies nearby, tier 6+."));
|
||||||
|
RunicOverchargeKey = config.Bind(keybinds, "Runic Overcharge", new KeyboardShortcut(KeyCode.H),
|
||||||
|
new ConfigDescription("Loads the next favoured-weapon blow with bonus damage, tier 8."));
|
||||||
|
|
||||||
|
const string combat = "Dvergar - Passive Combat";
|
||||||
|
ElementalDamagePerState = config.Bind(combat, "Elemental Damage Per State", 2f,
|
||||||
|
new ConfigDescription("Lightning added to every blow the player lands, multiplied by the current progression state.", new AcceptableValueRange<float>(0f, 10f)));
|
||||||
|
MinMaxHealth = config.Bind(combat, "Minimum Max Health", 5f,
|
||||||
|
new ConfigDescription("A Dvergar's max health is never reduced below this, however the per-tier malus lines up.", new AcceptableValueRange<float>(1f, 50f)));
|
||||||
|
WeaponAffinityDamagePercent = config.Bind(combat, "Weapon Affinity Damage Percent", 0.15f,
|
||||||
|
new ConfigDescription("Extra physical damage with a favoured weapon (Hammer/Bow/Axe/Crossbow), as a fraction.", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
WeaponAffinityStaminaPercent = config.Bind(combat, "Weapon Affinity Stamina Percent", 0.20f,
|
||||||
|
new ConfigDescription("Stamina refunded on attacks with a favoured weapon, as a fraction.", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
|
||||||
|
const string mining = "Dvergar - Mining";
|
||||||
|
MiningDamageMultiplier = config.Bind(mining, "Damage Multiplier", 1.20f,
|
||||||
|
new ConfigDescription("Multiplies pickaxe damage against rock, tier 2+.", new AcceptableValueRange<float>(1f, 3f)));
|
||||||
|
MiningStaminaPercent = config.Bind(mining, "Stamina Discount Percent", 0.40f,
|
||||||
|
new ConfigDescription("Stamina saved per pickaxe swing, as a fraction.", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
MiningExtraDropChance = config.Bind(mining, "Extra Ore Drop Chance", 0.25f,
|
||||||
|
new ConfigDescription("Chance a mined vein yields one extra unit of ore. 0 disables the yield half of the affinity.", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
|
||||||
|
const string ping = "Dvergar - Runic Ping";
|
||||||
|
RunicPingEitrCost = config.Bind(ping, "Eitr Cost", 25f,
|
||||||
|
new ConfigDescription("Eitr spent per cast.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
RunicPingRadius = config.Bind(ping, "Radius", 40f,
|
||||||
|
new ConfigDescription("Meters within which ore veins and hidden enemies are marked.", new AcceptableValueRange<float>(5f, 100f)));
|
||||||
|
RunicPingDuration = config.Bind(ping, "Marker Duration", 10f,
|
||||||
|
new ConfigDescription("Seconds a marker light stays lit.", new AcceptableValueRange<float>(1f, 60f)));
|
||||||
|
RunicPingCooldown = config.Bind(ping, "Cooldown", 20f,
|
||||||
|
new ConfigDescription("Seconds between casts.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
RunicPingLightRange = config.Bind(ping, "Marker Light Range", 8f,
|
||||||
|
new ConfigDescription("Range of each marker light.", new AcceptableValueRange<float>(1f, 30f)));
|
||||||
|
RunicPingLightIntensity = config.Bind(ping, "Marker Light Intensity", 2f,
|
||||||
|
new ConfigDescription("Intensity of each marker light.", new AcceptableValueRange<float>(0.1f, 10f)));
|
||||||
|
|
||||||
|
const string overcharge = "Dvergar - Runic Overcharge";
|
||||||
|
RunicOverchargeEitrCost = config.Bind(overcharge, "Eitr Cost", 60f,
|
||||||
|
new ConfigDescription("Eitr spent to load a charge.", new AcceptableValueRange<float>(0f, 200f)));
|
||||||
|
RunicOverchargeMultiplier = config.Bind(overcharge, "Damage Multiplier", 4f,
|
||||||
|
new ConfigDescription("Multiplies physical damage on the blow that discharges the loaded weapon.", new AcceptableValueRange<float>(1f, 10f)));
|
||||||
|
RunicOverchargeWindow = config.Bind(overcharge, "Charge Window", 15f,
|
||||||
|
new ConfigDescription("Seconds a loaded charge is held before it lapses unused.", new AcceptableValueRange<float>(1f, 60f)));
|
||||||
|
RunicOverchargeCooldown = config.Bind(overcharge, "Cooldown", 60f,
|
||||||
|
new ConfigDescription("Seconds between casts.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -41,10 +41,21 @@ namespace RacesOfValheim
|
||||||
state = Mathf.Clamp(state, BossProgressionManager.MinState, BossProgressionManager.MaxState);
|
state = Mathf.Clamp(state, BossProgressionManager.MinState, BossProgressionManager.MaxState);
|
||||||
if (cached[state]) return cache[state];
|
if (cached[state]) return cache[state];
|
||||||
|
|
||||||
|
// DamagePercent/StaminaPercent are overridden from DvergarConfigManagement here
|
||||||
|
// rather than in the WeaponAffinities array itself: that array is a static readonly
|
||||||
|
// field evaluated at class-load time, which can run before RacesOfValheim.Awake()
|
||||||
|
// calls DvergarConfigManagement.Bind - reading .Value there would risk a
|
||||||
|
// null-reference on the ConfigEntry. Reading it here, when rules are actually built,
|
||||||
|
// is always after Bind has run.
|
||||||
List<DvergarConfig.WeaponAffinity> affinities = new List<DvergarConfig.WeaponAffinity>();
|
List<DvergarConfig.WeaponAffinity> affinities = new List<DvergarConfig.WeaponAffinity>();
|
||||||
foreach (DvergarConfig.WeaponAffinity affinity in DvergarConfig.WeaponAffinities)
|
foreach (DvergarConfig.WeaponAffinity affinity in DvergarConfig.WeaponAffinities)
|
||||||
{
|
{
|
||||||
if (state >= affinity.UnlockState) affinities.Add(affinity);
|
if (state < affinity.UnlockState) continue;
|
||||||
|
|
||||||
|
DvergarConfig.WeaponAffinity live = affinity;
|
||||||
|
live.DamagePercent = DvergarConfigManagement.WeaponAffinityDamagePercent.Value;
|
||||||
|
live.StaminaPercent = DvergarConfigManagement.WeaponAffinityStaminaPercent.Value;
|
||||||
|
affinities.Add(live);
|
||||||
}
|
}
|
||||||
|
|
||||||
DvergarRules rules = new DvergarRules
|
DvergarRules rules = new DvergarRules
|
||||||
|
|
|
||||||
|
|
@ -58,17 +58,17 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
if (isGrounded && RaceInput.Allowed)
|
if (isGrounded && RaceInput.Allowed)
|
||||||
{
|
{
|
||||||
if (Input.GetKeyDown(KeyCode.O))
|
if (FenrirConfig.HowlKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
StartCoroutine(HowlRoutine());
|
StartCoroutine(HowlRoutine());
|
||||||
}
|
}
|
||||||
else if (Input.GetMouseButtonDown(1)) // Tasto destro (Heavy Claw)
|
else if (Input.GetMouseButtonDown(1)) // Tasto destro (Heavy Claw)
|
||||||
{
|
{
|
||||||
StartCoroutine(ClawRoutine("attack_claw1", 110f, 1.2f, 0.5f));
|
StartCoroutine(ClawRoutine("attack_claw1", FenrirConfig.FenringHeavyClawDamage.Value, 1.2f, 0.5f));
|
||||||
}
|
}
|
||||||
else if (Input.GetMouseButtonDown(0)) // Tasto sinistro
|
else if (Input.GetMouseButtonDown(0)) // Tasto sinistro
|
||||||
{
|
{
|
||||||
StartCoroutine(ClawRoutine("attack_claw0", 60f, 1.0f, 0.4f));
|
StartCoroutine(ClawRoutine("attack_claw0", FenrirConfig.FenringLightClawDamage.Value, 1.0f, 0.4f));
|
||||||
}
|
}
|
||||||
else if (Input.GetMouseButtonDown(2)) // Tasto centrale
|
else if (Input.GetMouseButtonDown(2)) // Tasto centrale
|
||||||
{
|
{
|
||||||
|
|
@ -173,11 +173,11 @@ namespace RacesOfValheim
|
||||||
Rigidbody rb = Player.m_localPlayer.GetComponent<Rigidbody>();
|
Rigidbody rb = Player.m_localPlayer.GetComponent<Rigidbody>();
|
||||||
if (rb != null)
|
if (rb != null)
|
||||||
{
|
{
|
||||||
Vector3 dashVelocity = Player.m_localPlayer.transform.forward * 31.5f;
|
Vector3 dashVelocity = Player.m_localPlayer.transform.forward * FenrirConfig.FenringJumpDashSpeed.Value;
|
||||||
// Spinta verso l'alto solo nella prima metà dello scatto
|
// Spinta verso l'alto solo nella prima metà dello scatto
|
||||||
if (elapsedDash < dashDuration / 2f)
|
if (elapsedDash < dashDuration / 2f)
|
||||||
{
|
{
|
||||||
dashVelocity += Vector3.up * 13.1f;
|
dashVelocity += Vector3.up * FenrirConfig.FenringJumpDashUpwardSpeed.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
rb.MovePosition(rb.position + dashVelocity * Time.fixedDeltaTime);
|
rb.MovePosition(rb.position + dashVelocity * Time.fixedDeltaTime);
|
||||||
|
|
@ -188,7 +188,7 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
|
|
||||||
// Infliggiamo il danno al termine dello scatto
|
// Infliggiamo il danno al termine dello scatto
|
||||||
ExecuteClawDamage(95f);
|
ExecuteClawDamage(FenrirConfig.FenringJumpAttackDamage.Value);
|
||||||
|
|
||||||
// Tempo per riprendersi dall'atterraggio prima di potersi muovere di nuovo
|
// Tempo per riprendersi dall'atterraggio prima di potersi muovere di nuovo
|
||||||
yield return new WaitForSeconds(0.55f);
|
yield return new WaitForSeconds(0.55f);
|
||||||
|
|
@ -203,7 +203,7 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
Vector3 playerPos = Player.m_localPlayer.transform.position;
|
Vector3 playerPos = Player.m_localPlayer.transform.position;
|
||||||
Vector3 attackPoint = playerPos + Player.m_localPlayer.transform.forward * 1.5f + Vector3.up * 1f;
|
Vector3 attackPoint = playerPos + Player.m_localPlayer.transform.forward * 1.5f + Vector3.up * 1f;
|
||||||
float attackRadius = 2.5f;
|
float attackRadius = FenrirConfig.FenringAttackRadius.Value;
|
||||||
|
|
||||||
float unarmedSkillLevel = Player.m_localPlayer.GetSkillLevel(Skills.SkillType.Unarmed);
|
float unarmedSkillLevel = Player.m_localPlayer.GetSkillLevel(Skills.SkillType.Unarmed);
|
||||||
float totalDamage = baseDamage + unarmedSkillLevel;
|
float totalDamage = baseDamage + unarmedSkillLevel;
|
||||||
|
|
@ -243,7 +243,7 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
HitData hitData = new HitData();
|
HitData hitData = new HitData();
|
||||||
hitData.m_damage.m_slash = totalDamage;
|
hitData.m_damage.m_slash = totalDamage;
|
||||||
hitData.m_pushForce = 30f;
|
hitData.m_pushForce = FenrirConfig.FenringPushForce.Value;
|
||||||
hitData.m_point = targetCenter;
|
hitData.m_point = targetCenter;
|
||||||
hitData.m_dir = Player.m_localPlayer.transform.forward;
|
hitData.m_dir = Player.m_localPlayer.transform.forward;
|
||||||
hitData.m_skill = Skills.SkillType.Unarmed;
|
hitData.m_skill = Skills.SkillType.Unarmed;
|
||||||
|
|
@ -339,7 +339,7 @@ namespace RacesOfValheim
|
||||||
StopFire();
|
StopFire();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canAct && Input.GetKeyDown(KeyCode.O))
|
if (canAct && FenrirConfig.HowlKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
StartCoroutine(HowlRoutine());
|
StartCoroutine(HowlRoutine());
|
||||||
}
|
}
|
||||||
|
|
@ -429,8 +429,7 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
private void UpdateFire()
|
private void UpdateFire()
|
||||||
{
|
{
|
||||||
// Drain Eitr ridotto del 50% (da 25 a 12.5 per sec)
|
Player.m_localPlayer.UseEitr(FenrirConfig.CultistFireEitrDrainPerSecond.Value * Time.deltaTime);
|
||||||
Player.m_localPlayer.UseEitr(12.5f * Time.deltaTime);
|
|
||||||
cultistAnim.SetFloat("forward_speed", 0f);
|
cultistAnim.SetFloat("forward_speed", 0f);
|
||||||
cultistAnim.SetFloat("sideway_speed", 0f);
|
cultistAnim.SetFloat("sideway_speed", 0f);
|
||||||
|
|
||||||
|
|
@ -460,11 +459,11 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
Vector3 playerPos = Player.m_localPlayer.transform.position;
|
Vector3 playerPos = Player.m_localPlayer.transform.position;
|
||||||
Vector3 attackPoint = playerPos + Player.m_localPlayer.transform.forward * 2.5f + Vector3.up * 1f;
|
Vector3 attackPoint = playerPos + Player.m_localPlayer.transform.forward * 2.5f + Vector3.up * 1f;
|
||||||
float attackRadius = 3f;
|
float attackRadius = FenrirConfig.CultistFireAttackRadius.Value;
|
||||||
|
|
||||||
float magicSkillLevel = Player.m_localPlayer.GetSkillLevel(Skills.SkillType.ElementalMagic);
|
float magicSkillLevel = Player.m_localPlayer.GetSkillLevel(Skills.SkillType.ElementalMagic);
|
||||||
float baseFireDamage = 20f; // per 0.2s
|
float baseFireDamage = FenrirConfig.CultistFireDamagePerTick.Value;
|
||||||
float totalDamage = baseFireDamage + (magicSkillLevel * 0.5f);
|
float totalDamage = baseFireDamage + (magicSkillLevel * FenrirConfig.CultistFireMagicSkillScaling.Value);
|
||||||
|
|
||||||
int layerMask = LayerMask.GetMask("Default", "static_solid", "Default_small", "piece", "piece_nonsolid", "terrain", "character", "character_net", "character_ghost", "hitbox", "character_noenv", "vehicle");
|
int layerMask = LayerMask.GetMask("Default", "static_solid", "Default_small", "piece", "piece_nonsolid", "terrain", "character", "character_net", "character_ghost", "hitbox", "character_noenv", "vehicle");
|
||||||
Collider[] hits = Physics.OverlapSphere(attackPoint, attackRadius, layerMask);
|
Collider[] hits = Physics.OverlapSphere(attackPoint, attackRadius, layerMask);
|
||||||
|
|
@ -531,7 +530,7 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
PlaySFX("sfx_cultist_attack", "sfx_fenring_attack", "sfx_wolf_attack");
|
PlaySFX("sfx_cultist_attack", "sfx_fenring_attack", "sfx_wolf_attack");
|
||||||
|
|
||||||
ExecuteClawDamage(85f);
|
ExecuteClawDamage(FenrirConfig.CultistClawDamage.Value);
|
||||||
|
|
||||||
float remainingTimeToIdle = 0.5f - 0.4f;
|
float remainingTimeToIdle = 0.5f - 0.4f;
|
||||||
if (remainingTimeToIdle > 0)
|
if (remainingTimeToIdle > 0)
|
||||||
|
|
@ -557,7 +556,7 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
PlaySFX("sfx_cultist_attack_double", "sfx_cultist_attack", "sfx_fenring_attack");
|
PlaySFX("sfx_cultist_attack_double", "sfx_cultist_attack", "sfx_fenring_attack");
|
||||||
|
|
||||||
ExecuteClawDamage(140f);
|
ExecuteClawDamage(FenrirConfig.CultistDoubleClawDamage.Value);
|
||||||
|
|
||||||
// Attendiamo che l'animazione finisca (locking del giocatore)
|
// Attendiamo che l'animazione finisca (locking del giocatore)
|
||||||
// L'animazione doppia del cultista dura circa 1.5 - 2 secondi
|
// L'animazione doppia del cultista dura circa 1.5 - 2 secondi
|
||||||
|
|
@ -573,7 +572,7 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
Vector3 playerPos = Player.m_localPlayer.transform.position;
|
Vector3 playerPos = Player.m_localPlayer.transform.position;
|
||||||
Vector3 attackPoint = playerPos + Player.m_localPlayer.transform.forward * 1.5f + Vector3.up * 1f;
|
Vector3 attackPoint = playerPos + Player.m_localPlayer.transform.forward * 1.5f + Vector3.up * 1f;
|
||||||
float attackRadius = 2.5f;
|
float attackRadius = FenrirConfig.CultistAttackRadius.Value;
|
||||||
|
|
||||||
float unarmedSkillLevel = Player.m_localPlayer.GetSkillLevel(Skills.SkillType.Unarmed);
|
float unarmedSkillLevel = Player.m_localPlayer.GetSkillLevel(Skills.SkillType.Unarmed);
|
||||||
float totalDamage = baseDamage + unarmedSkillLevel;
|
float totalDamage = baseDamage + unarmedSkillLevel;
|
||||||
|
|
@ -613,7 +612,7 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
HitData hitData = new HitData();
|
HitData hitData = new HitData();
|
||||||
hitData.m_damage.m_slash = totalDamage;
|
hitData.m_damage.m_slash = totalDamage;
|
||||||
hitData.m_pushForce = 30f;
|
hitData.m_pushForce = FenrirConfig.CultistPushForce.Value;
|
||||||
hitData.m_point = targetCenter;
|
hitData.m_point = targetCenter;
|
||||||
hitData.m_dir = Player.m_localPlayer.transform.forward;
|
hitData.m_dir = Player.m_localPlayer.transform.forward;
|
||||||
hitData.m_skill = Skills.SkillType.Unarmed;
|
hitData.m_skill = Skills.SkillType.Unarmed;
|
||||||
|
|
@ -679,15 +678,15 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
if (Input.GetMouseButtonDown(0)) // Left Click
|
if (Input.GetMouseButtonDown(0)) // Left Click
|
||||||
{
|
{
|
||||||
StartCoroutine(WolfAttackRoutine("attack1", 40f, 0.6f, 0.2f));
|
StartCoroutine(WolfAttackRoutine("attack1", FenrirConfig.WolfAttack1Damage.Value, 0.6f, 0.2f));
|
||||||
}
|
}
|
||||||
else if (Input.GetMouseButtonDown(1)) // Right Click
|
else if (Input.GetMouseButtonDown(1)) // Right Click
|
||||||
{
|
{
|
||||||
StartCoroutine(WolfAttackRoutine("attack2", 60f, 0.8f, 0.3f));
|
StartCoroutine(WolfAttackRoutine("attack2", FenrirConfig.WolfAttack2Damage.Value, 0.8f, 0.3f));
|
||||||
}
|
}
|
||||||
else if (Input.GetMouseButtonDown(2)) // Middle Click
|
else if (Input.GetMouseButtonDown(2)) // Middle Click
|
||||||
{
|
{
|
||||||
StartCoroutine(WolfAttackRoutine("attack3", 80f, 1.0f, 0.4f));
|
StartCoroutine(WolfAttackRoutine("attack3", FenrirConfig.WolfAttack3Damage.Value, 1.0f, 0.4f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -745,7 +744,7 @@ namespace RacesOfValheim
|
||||||
Vector3 playerPos = Player.m_localPlayer.transform.position;
|
Vector3 playerPos = Player.m_localPlayer.transform.position;
|
||||||
// Il lupo è basso, abbassiamo l'altezza dell'attacco
|
// Il lupo è basso, abbassiamo l'altezza dell'attacco
|
||||||
Vector3 attackPoint = playerPos + Player.m_localPlayer.transform.forward * 1.5f + Vector3.up * 0.5f;
|
Vector3 attackPoint = playerPos + Player.m_localPlayer.transform.forward * 1.5f + Vector3.up * 0.5f;
|
||||||
float attackRadius = 2.0f;
|
float attackRadius = FenrirConfig.WolfAttackRadius.Value;
|
||||||
|
|
||||||
float unarmedSkillLevel = Player.m_localPlayer.GetSkillLevel(Skills.SkillType.Unarmed);
|
float unarmedSkillLevel = Player.m_localPlayer.GetSkillLevel(Skills.SkillType.Unarmed);
|
||||||
float totalDamage = baseDamage + unarmedSkillLevel;
|
float totalDamage = baseDamage + unarmedSkillLevel;
|
||||||
|
|
@ -785,7 +784,7 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
HitData hitData = new HitData();
|
HitData hitData = new HitData();
|
||||||
hitData.m_damage.m_slash = totalDamage;
|
hitData.m_damage.m_slash = totalDamage;
|
||||||
hitData.m_pushForce = 20f;
|
hitData.m_pushForce = FenrirConfig.WolfPushForce.Value;
|
||||||
hitData.m_point = targetCenter;
|
hitData.m_point = targetCenter;
|
||||||
hitData.m_dir = Player.m_localPlayer.transform.forward;
|
hitData.m_dir = Player.m_localPlayer.transform.forward;
|
||||||
hitData.m_skill = Skills.SkillType.Unarmed;
|
hitData.m_skill = Skills.SkillType.Unarmed;
|
||||||
|
|
@ -852,12 +851,12 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
if (Input.GetMouseButtonDown(0)) // Left Click
|
if (Input.GetMouseButtonDown(0)) // Left Click
|
||||||
{
|
{
|
||||||
StartCoroutine(UlvAttackRoutine("attack_bite", 40f, 0.6f, 0.2f));
|
StartCoroutine(UlvAttackRoutine("attack_bite", FenrirConfig.UlvBiteDamage.Value, 0.6f, 0.2f));
|
||||||
}
|
}
|
||||||
else if (Input.GetMouseButtonDown(1)) // Right Click
|
else if (Input.GetMouseButtonDown(1)) // Right Click
|
||||||
{
|
{
|
||||||
// Right click uses bite but as a heavier attack since slash is moved to jump
|
// Right click uses bite but as a heavier attack since slash is moved to jump
|
||||||
StartCoroutine(UlvAttackRoutine("attack_bite", 60f, 0.8f, 0.3f));
|
StartCoroutine(UlvAttackRoutine("attack_bite", FenrirConfig.UlvHeavyBiteDamage.Value, 0.8f, 0.3f));
|
||||||
}
|
}
|
||||||
else if (Input.GetMouseButtonDown(2)) // Middle Click
|
else if (Input.GetMouseButtonDown(2)) // Middle Click
|
||||||
{
|
{
|
||||||
|
|
@ -928,7 +927,7 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
Vector3 playerPos = Player.m_localPlayer.transform.position;
|
Vector3 playerPos = Player.m_localPlayer.transform.position;
|
||||||
Vector3 attackPoint = playerPos + Player.m_localPlayer.transform.forward * 1.5f + Vector3.up * 0.5f;
|
Vector3 attackPoint = playerPos + Player.m_localPlayer.transform.forward * 1.5f + Vector3.up * 0.5f;
|
||||||
float attackRadius = 2.0f;
|
float attackRadius = FenrirConfig.UlvAttackRadius.Value;
|
||||||
|
|
||||||
float unarmedSkillLevel = Player.m_localPlayer.GetSkillLevel(Skills.SkillType.Unarmed);
|
float unarmedSkillLevel = Player.m_localPlayer.GetSkillLevel(Skills.SkillType.Unarmed);
|
||||||
float totalDamage = baseDamage + unarmedSkillLevel;
|
float totalDamage = baseDamage + unarmedSkillLevel;
|
||||||
|
|
@ -968,7 +967,7 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
HitData hitData = new HitData();
|
HitData hitData = new HitData();
|
||||||
hitData.m_damage.m_slash = totalDamage;
|
hitData.m_damage.m_slash = totalDamage;
|
||||||
hitData.m_pushForce = 25f;
|
hitData.m_pushForce = FenrirConfig.UlvPushForce.Value;
|
||||||
hitData.m_point = targetCenter;
|
hitData.m_point = targetCenter;
|
||||||
hitData.m_dir = Player.m_localPlayer.transform.forward;
|
hitData.m_dir = Player.m_localPlayer.transform.forward;
|
||||||
hitData.m_skill = Skills.SkillType.Unarmed;
|
hitData.m_skill = Skills.SkillType.Unarmed;
|
||||||
|
|
@ -999,7 +998,7 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
// Leap forward (+50% range)
|
// Leap forward (+50% range)
|
||||||
float leapDuration = 0.25f;
|
float leapDuration = 0.25f;
|
||||||
float leapSpeed = 18f; // Increased from 12f to 18f
|
float leapSpeed = FenrirConfig.UlvLeapSpeed.Value;
|
||||||
float elapsed = 0f;
|
float elapsed = 0f;
|
||||||
|
|
||||||
while (elapsed < leapDuration)
|
while (elapsed < leapDuration)
|
||||||
|
|
@ -1022,7 +1021,7 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ExecuteBiteDamage(80f);
|
ExecuteBiteDamage(FenrirConfig.UlvJumpAttackDamage.Value);
|
||||||
|
|
||||||
yield return new WaitForSeconds(0.4f);
|
yield return new WaitForSeconds(0.4f);
|
||||||
|
|
||||||
|
|
|
||||||
211
JotunnModStub/Fenrir/FenrirConfig.cs
Normal file
211
JotunnModStub/Fenrir/FenrirConfig.cs
Normal file
|
|
@ -0,0 +1,211 @@
|
||||||
|
using UnityEngine;
|
||||||
|
using BepInEx.Configuration;
|
||||||
|
|
||||||
|
namespace RacesOfValheim
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Every tunable number and keybind behind the Fenrir's abilities and special attacks, bound
|
||||||
|
/// as BepInEx ConfigEntry so they show up in Configuration Manager without touching code - see
|
||||||
|
/// CONFIGURATION-MANAGER-HOWTO.md. Bound once, from RacesOfValheim.Awake(). One section per
|
||||||
|
/// topic (matches SkadiConfig/AswidConfig/DraughConfig's layout).
|
||||||
|
///
|
||||||
|
/// Only the four transform/howl keys are exposed as rebindable - unlike Skadi's dragon forms,
|
||||||
|
/// which share one unified attack-button scheme across all three forms, each of Fenrir's four
|
||||||
|
/// forms (Fenring, Cultist, Wolf, Ulv) is an independent MonoBehaviour with its own hardcoded
|
||||||
|
/// mouse-button reads. Rebinding all of those individually would be a much larger, more
|
||||||
|
/// error-prone change for comparatively little value over just leaving attacks on the mouse,
|
||||||
|
/// which is where an action game's combat inputs are expected to live.
|
||||||
|
///
|
||||||
|
/// One caveat: the Form Buffs section is read once, into the status effects built by
|
||||||
|
/// FenrirRace.CreateModAssets on mod startup - not every frame. Retuning those values
|
||||||
|
/// mid-session needs a relog to take effect. Everything else (Passive Combat, every attack's
|
||||||
|
/// numbers) is read live on every use.
|
||||||
|
/// </summary>
|
||||||
|
public static class FenrirConfig
|
||||||
|
{
|
||||||
|
// ─── Keybinds ──────────────────────────────────────────────────────────
|
||||||
|
// Defaults match today's fixed inputs exactly, so nobody's controls change until they
|
||||||
|
// open Configuration Manager (or the .cfg) and rebind one on purpose.
|
||||||
|
public static ConfigEntry<KeyboardShortcut> WolfFormKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> FenrirFormKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> CultistFormKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> HowlKey;
|
||||||
|
|
||||||
|
// ─── Passive combat (scales with progression state) ──────────────────
|
||||||
|
public static ConfigEntry<float> ArmorBonusPerState;
|
||||||
|
public static ConfigEntry<float> DamageBonusPerState;
|
||||||
|
public static ConfigEntry<float> FallDamageReductionPerState;
|
||||||
|
public static ConfigEntry<float> SpeedBonusPerState;
|
||||||
|
public static ConfigEntry<float> JumpBonusPerState;
|
||||||
|
public static ConfigEntry<float> SunSicknessDuration;
|
||||||
|
|
||||||
|
// ─── Form buffs (applied while transformed) ───────────────────────────
|
||||||
|
public static ConfigEntry<float> FullFormSpeedBonus;
|
||||||
|
public static ConfigEntry<float> FullFormJumpBonus;
|
||||||
|
public static ConfigEntry<float> FullFormFallDamageReduction;
|
||||||
|
public static ConfigEntry<float> WolfFormSpeedBonus;
|
||||||
|
public static ConfigEntry<float> WolfFormFallDamageReduction;
|
||||||
|
public static ConfigEntry<float> FormStaminaRegenMultiplier;
|
||||||
|
public static ConfigEntry<float> FormStaminaDrainReduction;
|
||||||
|
|
||||||
|
// ─── Fenring form attacks ─────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> FenringHeavyClawDamage;
|
||||||
|
public static ConfigEntry<float> FenringLightClawDamage;
|
||||||
|
public static ConfigEntry<float> FenringJumpAttackDamage;
|
||||||
|
public static ConfigEntry<float> FenringJumpDashSpeed;
|
||||||
|
public static ConfigEntry<float> FenringJumpDashUpwardSpeed;
|
||||||
|
public static ConfigEntry<float> FenringAttackRadius;
|
||||||
|
public static ConfigEntry<float> FenringPushForce;
|
||||||
|
|
||||||
|
// ─── Cultist form attacks ──────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> CultistClawDamage;
|
||||||
|
public static ConfigEntry<float> CultistDoubleClawDamage;
|
||||||
|
public static ConfigEntry<float> CultistAttackRadius;
|
||||||
|
public static ConfigEntry<float> CultistPushForce;
|
||||||
|
public static ConfigEntry<float> CultistFireDamagePerTick;
|
||||||
|
public static ConfigEntry<float> CultistFireEitrDrainPerSecond;
|
||||||
|
public static ConfigEntry<float> CultistFireMagicSkillScaling;
|
||||||
|
public static ConfigEntry<float> CultistFireAttackRadius;
|
||||||
|
|
||||||
|
// ─── Wolf form attacks ─────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> WolfAttack1Damage;
|
||||||
|
public static ConfigEntry<float> WolfAttack2Damage;
|
||||||
|
public static ConfigEntry<float> WolfAttack3Damage;
|
||||||
|
public static ConfigEntry<float> WolfAttackRadius;
|
||||||
|
public static ConfigEntry<float> WolfPushForce;
|
||||||
|
|
||||||
|
// ─── Ulv form attacks ──────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> UlvBiteDamage;
|
||||||
|
public static ConfigEntry<float> UlvHeavyBiteDamage;
|
||||||
|
public static ConfigEntry<float> UlvJumpAttackDamage;
|
||||||
|
public static ConfigEntry<float> UlvLeapSpeed;
|
||||||
|
public static ConfigEntry<float> UlvAttackRadius;
|
||||||
|
public static ConfigEntry<float> UlvPushForce;
|
||||||
|
|
||||||
|
public static void Bind(ConfigFile config)
|
||||||
|
{
|
||||||
|
const string keybinds = "Fenrir - Keybinds";
|
||||||
|
WolfFormKey = config.Bind(keybinds, "Wolf Form", new KeyboardShortcut(KeyCode.G),
|
||||||
|
new ConfigDescription("Transform into (or revert from) a Wolf/Ulv, tier 3+."));
|
||||||
|
FenrirFormKey = config.Bind(keybinds, "Fenrir Form", new KeyboardShortcut(KeyCode.H),
|
||||||
|
new ConfigDescription("Transform into (or revert from) a Fenring/Ulv, tier 4+."));
|
||||||
|
CultistFormKey = config.Bind(keybinds, "Cultist Form", new KeyboardShortcut(KeyCode.J),
|
||||||
|
new ConfigDescription("Transform into (or revert from) a Cultist, tier 6+."));
|
||||||
|
HowlKey = config.Bind(keybinds, "Howl", new KeyboardShortcut(KeyCode.O),
|
||||||
|
new ConfigDescription("Howls in Fenring or Cultist form. Cosmetic only."));
|
||||||
|
|
||||||
|
const string combat = "Fenrir - Passive Combat";
|
||||||
|
ArmorBonusPerState = config.Bind(combat, "Armor Bonus Per State", 3f,
|
||||||
|
new ConfigDescription("Flat armor added, per progression state.", new AcceptableValueRange<float>(0f, 20f)));
|
||||||
|
DamageBonusPerState = config.Bind(combat, "Damage Bonus Per State", 5f,
|
||||||
|
new ConfigDescription("Flat physical damage added to equipped weapons, per progression state.", new AcceptableValueRange<float>(0f, 20f)));
|
||||||
|
FallDamageReductionPerState = config.Bind(combat, "Fall Damage Reduction Per State", 0.1f,
|
||||||
|
new ConfigDescription("Fall damage reduction added per progression state, capped at 100%.", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
SpeedBonusPerState = config.Bind(combat, "Speed Bonus Per State", 0.03f,
|
||||||
|
new ConfigDescription("Move speed multiplier added, per progression state.", new AcceptableValueRange<float>(0f, 0.2f)));
|
||||||
|
JumpBonusPerState = config.Bind(combat, "Jump Bonus Per State", 0.03f,
|
||||||
|
new ConfigDescription("Jump height multiplier added, per progression state.", new AcceptableValueRange<float>(0f, 0.2f)));
|
||||||
|
SunSicknessDuration = config.Bind(combat, "Sun Sickness Duration", 60f,
|
||||||
|
new ConfigDescription("Seconds of forced human form after being reverted by sunrise.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
|
||||||
|
const string buffs = "Fenrir - Form Buffs";
|
||||||
|
BindNote(config, buffs, "Note: these values need a relog to take effect.");
|
||||||
|
FullFormSpeedBonus = config.Bind(buffs, "Full Form Speed Bonus", 1.0f,
|
||||||
|
new ConfigDescription("Speed multiplier bonus while in Fenring or Cultist form.", new AcceptableValueRange<float>(0f, 3f)));
|
||||||
|
FullFormJumpBonus = config.Bind(buffs, "Full Form Jump Bonus", 1.0f,
|
||||||
|
new ConfigDescription("Jump multiplier bonus while in Fenring or Cultist form.", new AcceptableValueRange<float>(0f, 3f)));
|
||||||
|
FullFormFallDamageReduction = config.Bind(buffs, "Full Form Fall Damage Reduction", 1.0f,
|
||||||
|
new ConfigDescription("Fall damage reduction while in Fenring or Cultist form (1 = immune).", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
WolfFormSpeedBonus = config.Bind(buffs, "Wolf Form Speed Bonus", 0.5f,
|
||||||
|
new ConfigDescription("Speed multiplier bonus while in Wolf or Ulv form.", new AcceptableValueRange<float>(0f, 3f)));
|
||||||
|
WolfFormFallDamageReduction = config.Bind(buffs, "Wolf Form Fall Damage Reduction", 0.5f,
|
||||||
|
new ConfigDescription("Fall damage reduction while in Wolf or Ulv form.", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
FormStaminaRegenMultiplier = config.Bind(buffs, "Stamina Regen Multiplier", 1.3f,
|
||||||
|
new ConfigDescription("Stamina regen multiplier in any transformed state.", new AcceptableValueRange<float>(1f, 5f)));
|
||||||
|
FormStaminaDrainReduction = config.Bind(buffs, "Stamina Drain Reduction", 0.2f,
|
||||||
|
new ConfigDescription("Reduction to running stamina drain in any transformed state.", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
|
||||||
|
const string fenring = "Fenrir - Fenring Attacks";
|
||||||
|
FenringHeavyClawDamage = config.Bind(fenring, "Heavy Claw Damage", 110f,
|
||||||
|
new ConfigDescription("Base damage of the heavy claw (Right Mouse), before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 500f)));
|
||||||
|
FenringLightClawDamage = config.Bind(fenring, "Light Claw Damage", 60f,
|
||||||
|
new ConfigDescription("Base damage of the light claw (Left Mouse), before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 500f)));
|
||||||
|
FenringJumpAttackDamage = config.Bind(fenring, "Jump Attack Damage", 95f,
|
||||||
|
new ConfigDescription("Base damage of the leaping attack (Middle Mouse), before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 500f)));
|
||||||
|
FenringJumpDashSpeed = config.Bind(fenring, "Jump Dash Speed", 31.5f,
|
||||||
|
new ConfigDescription("Forward speed during the leap.", new AcceptableValueRange<float>(0f, 60f)));
|
||||||
|
FenringJumpDashUpwardSpeed = config.Bind(fenring, "Jump Dash Upward Speed", 13.1f,
|
||||||
|
new ConfigDescription("Upward speed during the first half of the leap.", new AcceptableValueRange<float>(0f, 30f)));
|
||||||
|
FenringAttackRadius = config.Bind(fenring, "Attack Radius", 2.5f,
|
||||||
|
new ConfigDescription("Hit-sweep radius for all three attacks.", new AcceptableValueRange<float>(1f, 10f)));
|
||||||
|
FenringPushForce = config.Bind(fenring, "Push Force", 30f,
|
||||||
|
new ConfigDescription("Knockback applied on a hit.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
|
||||||
|
const string cultist = "Fenrir - Cultist Attacks";
|
||||||
|
CultistClawDamage = config.Bind(cultist, "Claw Damage", 85f,
|
||||||
|
new ConfigDescription("Base damage of the single claw (Left Mouse), before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 500f)));
|
||||||
|
CultistDoubleClawDamage = config.Bind(cultist, "Double Claw Damage", 140f,
|
||||||
|
new ConfigDescription("Base damage of the double claw (Middle Mouse), before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 500f)));
|
||||||
|
CultistAttackRadius = config.Bind(cultist, "Claw Attack Radius", 2.5f,
|
||||||
|
new ConfigDescription("Hit-sweep radius for both claw attacks.", new AcceptableValueRange<float>(1f, 10f)));
|
||||||
|
CultistPushForce = config.Bind(cultist, "Claw Push Force", 30f,
|
||||||
|
new ConfigDescription("Knockback applied by a claw hit.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
CultistFireDamagePerTick = config.Bind(cultist, "Fire Damage Per Tick", 20f,
|
||||||
|
new ConfigDescription("Fire damage per 0.2s tick while channeling (Right Mouse held), before the Elemental Magic skill bonus.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
CultistFireEitrDrainPerSecond = config.Bind(cultist, "Fire Eitr Drain Per Second", 12.5f,
|
||||||
|
new ConfigDescription("Eitr spent per second while channeling fire.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
CultistFireMagicSkillScaling = config.Bind(cultist, "Fire Magic Skill Scaling", 0.5f,
|
||||||
|
new ConfigDescription("Extra fire damage per tick, per point of Elemental Magic skill.", new AcceptableValueRange<float>(0f, 5f)));
|
||||||
|
CultistFireAttackRadius = config.Bind(cultist, "Fire Attack Radius", 3f,
|
||||||
|
new ConfigDescription("Hit-sweep radius for the fire breath.", new AcceptableValueRange<float>(1f, 15f)));
|
||||||
|
|
||||||
|
const string wolf = "Fenrir - Wolf Attacks";
|
||||||
|
WolfAttack1Damage = config.Bind(wolf, "Attack 1 Damage", 40f,
|
||||||
|
new ConfigDescription("Base damage of the Left Mouse attack, before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
WolfAttack2Damage = config.Bind(wolf, "Attack 2 Damage", 60f,
|
||||||
|
new ConfigDescription("Base damage of the Right Mouse attack, before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
WolfAttack3Damage = config.Bind(wolf, "Attack 3 Damage", 80f,
|
||||||
|
new ConfigDescription("Base damage of the Middle Mouse attack, before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
WolfAttackRadius = config.Bind(wolf, "Attack Radius", 2.0f,
|
||||||
|
new ConfigDescription("Hit-sweep radius for all three attacks.", new AcceptableValueRange<float>(1f, 10f)));
|
||||||
|
WolfPushForce = config.Bind(wolf, "Push Force", 20f,
|
||||||
|
new ConfigDescription("Knockback applied on a hit.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
|
||||||
|
const string ulv = "Fenrir - Ulv Attacks";
|
||||||
|
UlvBiteDamage = config.Bind(ulv, "Bite Damage", 40f,
|
||||||
|
new ConfigDescription("Base damage of the Left Mouse bite, before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
UlvHeavyBiteDamage = config.Bind(ulv, "Heavy Bite Damage", 60f,
|
||||||
|
new ConfigDescription("Base damage of the Right Mouse bite, before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
UlvJumpAttackDamage = config.Bind(ulv, "Jump Attack Damage", 80f,
|
||||||
|
new ConfigDescription("Base damage of the leaping Middle Mouse attack, before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
UlvLeapSpeed = config.Bind(ulv, "Leap Speed", 18f,
|
||||||
|
new ConfigDescription("Forward speed during the leap attack.", new AcceptableValueRange<float>(0f, 40f)));
|
||||||
|
UlvAttackRadius = config.Bind(ulv, "Attack Radius", 2.0f,
|
||||||
|
new ConfigDescription("Hit-sweep radius for all three attacks.", new AcceptableValueRange<float>(1f, 10f)));
|
||||||
|
UlvPushForce = config.Bind(ulv, "Push Force", 25f,
|
||||||
|
new ConfigDescription("Knockback applied on a hit.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A non-editable line of text, standing in for the caveat comment this class carries at
|
||||||
|
/// the top - Configuration Manager has no label widget of its own, so this binds a real
|
||||||
|
/// (unused) bool ConfigEntry and replaces its value widget with nothing via CustomDrawer,
|
||||||
|
/// same trick used for section dividers earlier in this mod's config work. A high Order
|
||||||
|
/// keeps it above the section's other entries, which are left at the default Order and so
|
||||||
|
/// sort alphabetically among themselves.
|
||||||
|
/// </summary>
|
||||||
|
private static void BindNote(ConfigFile config, string section, string text)
|
||||||
|
{
|
||||||
|
config.Bind(section, text, false, new ConfigDescription(
|
||||||
|
"", null, new ConfigurationManagerAttributes
|
||||||
|
{
|
||||||
|
Order = 100,
|
||||||
|
CustomDrawer = DrawNothing,
|
||||||
|
HideDefaultButton = true,
|
||||||
|
ReadOnly = true
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void DrawNothing(ConfigEntryBase entry) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -32,27 +32,27 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
public static float GetArmorBonus(int state)
|
public static float GetArmorBonus(int state)
|
||||||
{
|
{
|
||||||
return 3f * state;
|
return FenrirConfig.ArmorBonusPerState.Value * state;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float GetDamageBonus(int state)
|
public static float GetDamageBonus(int state)
|
||||||
{
|
{
|
||||||
return 5f * state;
|
return FenrirConfig.DamageBonusPerState.Value * state;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float GetFallDamageModifier(int state)
|
public static float GetFallDamageModifier(int state)
|
||||||
{
|
{
|
||||||
return Mathf.Clamp(-0.1f * state, -1f, 0f);
|
return Mathf.Clamp(-FenrirConfig.FallDamageReductionPerState.Value * state, -1f, 0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float GetSpeedModifier(int state)
|
public static float GetSpeedModifier(int state)
|
||||||
{
|
{
|
||||||
return 0.03f * state;
|
return FenrirConfig.SpeedBonusPerState.Value * state;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float GetJumpModifier(int state)
|
public static float GetJumpModifier(int state)
|
||||||
{
|
{
|
||||||
return 0.03f * state;
|
return FenrirConfig.JumpBonusPerState.Value * state;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Transformation Rules for Keys ---
|
// --- Transformation Rules for Keys ---
|
||||||
|
|
|
||||||
|
|
@ -67,32 +67,32 @@ namespace RacesOfValheim {
|
||||||
formBuffSE = ScriptableObject.CreateInstance<SE_Stats>();
|
formBuffSE = ScriptableObject.CreateInstance<SE_Stats>();
|
||||||
formBuffSE.name = "SE_FenrirForm";
|
formBuffSE.name = "SE_FenrirForm";
|
||||||
formBuffSE.m_name = "Bestial Fury";
|
formBuffSE.m_name = "Bestial Fury";
|
||||||
formBuffSE.m_speedModifier = 1.0f;
|
formBuffSE.m_speedModifier = FenrirConfig.FullFormSpeedBonus.Value;
|
||||||
formBuffSE.m_jumpModifier = new Vector3(0, 1.0f, 0);
|
formBuffSE.m_jumpModifier = new Vector3(0, FenrirConfig.FullFormJumpBonus.Value, 0);
|
||||||
formBuffSE.m_fallDamageModifier = -1f;
|
formBuffSE.m_fallDamageModifier = -FenrirConfig.FullFormFallDamageReduction.Value;
|
||||||
formBuffSE.m_staminaRegenMultiplier = 1.3f;
|
formBuffSE.m_staminaRegenMultiplier = FenrirConfig.FormStaminaRegenMultiplier.Value;
|
||||||
formBuffSE.m_runStaminaDrainModifier = -0.2f;
|
formBuffSE.m_runStaminaDrainModifier = -FenrirConfig.FormStaminaDrainReduction.Value;
|
||||||
formBuffSE.m_icon = fenringTrophyIcon;
|
formBuffSE.m_icon = fenringTrophyIcon;
|
||||||
ItemManager.Instance.AddStatusEffect(new CustomStatusEffect(formBuffSE, fixReference: false));
|
ItemManager.Instance.AddStatusEffect(new CustomStatusEffect(formBuffSE, fixReference: false));
|
||||||
|
|
||||||
cultistFormBuffSE = ScriptableObject.CreateInstance<SE_Stats>();
|
cultistFormBuffSE = ScriptableObject.CreateInstance<SE_Stats>();
|
||||||
cultistFormBuffSE.name = "SE_CultistForm";
|
cultistFormBuffSE.name = "SE_CultistForm";
|
||||||
cultistFormBuffSE.m_name = "Cultist Fury";
|
cultistFormBuffSE.m_name = "Cultist Fury";
|
||||||
cultistFormBuffSE.m_speedModifier = 1.0f;
|
cultistFormBuffSE.m_speedModifier = FenrirConfig.FullFormSpeedBonus.Value;
|
||||||
cultistFormBuffSE.m_jumpModifier = new Vector3(0, 1.0f, 0);
|
cultistFormBuffSE.m_jumpModifier = new Vector3(0, FenrirConfig.FullFormJumpBonus.Value, 0);
|
||||||
cultistFormBuffSE.m_fallDamageModifier = -1f;
|
cultistFormBuffSE.m_fallDamageModifier = -FenrirConfig.FullFormFallDamageReduction.Value;
|
||||||
cultistFormBuffSE.m_staminaRegenMultiplier = 1.3f;
|
cultistFormBuffSE.m_staminaRegenMultiplier = FenrirConfig.FormStaminaRegenMultiplier.Value;
|
||||||
cultistFormBuffSE.m_runStaminaDrainModifier = -0.2f;
|
cultistFormBuffSE.m_runStaminaDrainModifier = -FenrirConfig.FormStaminaDrainReduction.Value;
|
||||||
cultistFormBuffSE.m_icon = fenringTrophyIcon;
|
cultistFormBuffSE.m_icon = fenringTrophyIcon;
|
||||||
ItemManager.Instance.AddStatusEffect(new CustomStatusEffect(cultistFormBuffSE, fixReference: false));
|
ItemManager.Instance.AddStatusEffect(new CustomStatusEffect(cultistFormBuffSE, fixReference: false));
|
||||||
|
|
||||||
wolfFormBuffSE = ScriptableObject.CreateInstance<SE_Stats>();
|
wolfFormBuffSE = ScriptableObject.CreateInstance<SE_Stats>();
|
||||||
wolfFormBuffSE.name = "SE_WolfForm";
|
wolfFormBuffSE.name = "SE_WolfForm";
|
||||||
wolfFormBuffSE.m_name = "Wolf Senses";
|
wolfFormBuffSE.m_name = "Wolf Senses";
|
||||||
wolfFormBuffSE.m_speedModifier = 0.5f;
|
wolfFormBuffSE.m_speedModifier = FenrirConfig.WolfFormSpeedBonus.Value;
|
||||||
wolfFormBuffSE.m_fallDamageModifier = -0.5f;
|
wolfFormBuffSE.m_fallDamageModifier = -FenrirConfig.WolfFormFallDamageReduction.Value;
|
||||||
wolfFormBuffSE.m_staminaRegenMultiplier = 1.3f;
|
wolfFormBuffSE.m_staminaRegenMultiplier = FenrirConfig.FormStaminaRegenMultiplier.Value;
|
||||||
wolfFormBuffSE.m_runStaminaDrainModifier = -0.2f;
|
wolfFormBuffSE.m_runStaminaDrainModifier = -FenrirConfig.FormStaminaDrainReduction.Value;
|
||||||
wolfFormBuffSE.m_icon = fenringTrophyIcon;
|
wolfFormBuffSE.m_icon = fenringTrophyIcon;
|
||||||
ItemManager.Instance.AddStatusEffect(new CustomStatusEffect(wolfFormBuffSE, fixReference: false));
|
ItemManager.Instance.AddStatusEffect(new CustomStatusEffect(wolfFormBuffSE, fixReference: false));
|
||||||
}
|
}
|
||||||
|
|
@ -125,8 +125,8 @@ namespace RacesOfValheim {
|
||||||
}
|
}
|
||||||
else if (!isNight && wasNight)
|
else if (!isNight && wasNight)
|
||||||
{
|
{
|
||||||
// Sunrise: force revert and block for 60 seconds
|
// Sunrise: force revert and block transforming again for a while
|
||||||
sunSicknessTimer = 60f;
|
sunSicknessTimer = FenrirConfig.SunSicknessDuration.Value;
|
||||||
ForceRevert();
|
ForceRevert();
|
||||||
}
|
}
|
||||||
wasNight = isNight;
|
wasNight = isNight;
|
||||||
|
|
@ -147,9 +147,9 @@ namespace RacesOfValheim {
|
||||||
|
|
||||||
int state = BossProgressionManager.GetCurrentProgressionState();
|
int state = BossProgressionManager.GetCurrentProgressionState();
|
||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.G)) { TryTransformWithRules(FenrirProgression.GetGKeyRules(state)); return; }
|
if (FenrirConfig.WolfFormKey.Value.IsDown()) { TryTransformWithRules(FenrirProgression.GetGKeyRules(state)); return; }
|
||||||
if (Input.GetKeyDown(KeyCode.H)) { TryTransformWithRules(FenrirProgression.GetHKeyRules(state)); return; }
|
if (FenrirConfig.FenrirFormKey.Value.IsDown()) { TryTransformWithRules(FenrirProgression.GetHKeyRules(state)); return; }
|
||||||
if (Input.GetKeyDown(KeyCode.J)) { TryTransformWithRules(FenrirProgression.GetJKeyRules(state)); return; }
|
if (FenrirConfig.CultistFormKey.Value.IsDown()) { TryTransformWithRules(FenrirProgression.GetJKeyRules(state)); return; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TryTransformWithRules(FenrirProgression.FormRules rules)
|
private void TryTransformWithRules(FenrirProgression.FormRules rules)
|
||||||
|
|
|
||||||
88
JotunnModStub/Furling/FurlingConfig.cs
Normal file
88
JotunnModStub/Furling/FurlingConfig.cs
Normal file
|
|
@ -0,0 +1,88 @@
|
||||||
|
using BepInEx.Configuration;
|
||||||
|
|
||||||
|
namespace RacesOfValheim
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Every tunable number behind the Furling's abilities, bound as BepInEx ConfigEntry so they
|
||||||
|
/// show up in Configuration Manager without touching code - see
|
||||||
|
/// CONFIGURATION-MANAGER-HOWTO.md. Bound once, from RacesOfValheim.Awake(). One section per
|
||||||
|
/// topic (matches the other races' layout).
|
||||||
|
///
|
||||||
|
/// No keybinds section: every Furling ability is passive, triggered automatically by tier,
|
||||||
|
/// biome, or combat events rather than a key press - unlike every other race so far.
|
||||||
|
///
|
||||||
|
/// Tier-gate thresholds (which progression state unlocks each ability) are left as-is, same
|
||||||
|
/// boundary drawn for every other race's progression table - not exposed here. "Dance of the
|
||||||
|
/// Dead" (tier 4+, doubles alchemy/ammo craft yield) has no numeric knob either: it works by
|
||||||
|
/// crafting a second copy of the output rather than multiplying a configurable amount, so
|
||||||
|
/// there is nothing here to bind.
|
||||||
|
/// </summary>
|
||||||
|
public static class FurlingConfig
|
||||||
|
{
|
||||||
|
// ─── Passive combat (always active, no tier gate) ────────────────────
|
||||||
|
public static ConfigEntry<float> RunSpeedBonus;
|
||||||
|
public static ConfigEntry<float> WeaponSkillXPMultiplier;
|
||||||
|
public static ConfigEntry<float> IgniteOnHitMinFireDamage;
|
||||||
|
|
||||||
|
// ─── Master of Shadows (tier 2+) ──────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> StealthNoiseRangeThreshold;
|
||||||
|
|
||||||
|
// ─── The Wickerman (tier 3+) ───────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> WickermanFireResistMultiplier;
|
||||||
|
public static ConfigEntry<float> PoisonResistMultiplier;
|
||||||
|
public static ConfigEntry<float> FireArrowMinDamage;
|
||||||
|
|
||||||
|
// ─── Grave Robber (tier 5+) ────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> TrophyDropMultiplier;
|
||||||
|
public static ConfigEntry<float> TrophyDoublingRadius;
|
||||||
|
public static ConfigEntry<int> CoinsPerStarMin;
|
||||||
|
public static ConfigEntry<int> CoinsPerStarMax;
|
||||||
|
|
||||||
|
// ─── The King is Dead (tier 6+) ───────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> PlainsSkillXPMultiplier;
|
||||||
|
|
||||||
|
// ─── In the Mist (tier 7+) ─────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> EitrFoodDigestionSlowdown;
|
||||||
|
|
||||||
|
public static void Bind(ConfigFile config)
|
||||||
|
{
|
||||||
|
const string combat = "Furling - Passive Combat";
|
||||||
|
RunSpeedBonus = config.Bind(combat, "Run Speed Bonus", 0.1f,
|
||||||
|
new ConfigDescription("Move speed multiplier bonus, always active.", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
WeaponSkillXPMultiplier = config.Bind(combat, "Weapon Skill XP Multiplier", 2f,
|
||||||
|
new ConfigDescription("Multiplies XP gain for every weapon skill, always active.", new AcceptableValueRange<float>(0.5f, 5f)));
|
||||||
|
IgniteOnHitMinFireDamage = config.Bind(combat, "Ignite On Hit Min Fire Damage", 10f,
|
||||||
|
new ConfigDescription("Minimum fire damage added to a physical hit, tier 8+ (Through Fire and Flames).", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
|
||||||
|
const string shadows = "Furling - Master of Shadows";
|
||||||
|
StealthNoiseRangeThreshold = config.Bind(shadows, "Noise Range Threshold", 15f,
|
||||||
|
new ConfigDescription("Noise events at or below this range are suppressed entirely, tier 2+.", new AcceptableValueRange<float>(0f, 50f)));
|
||||||
|
|
||||||
|
const string wickerman = "Furling - The Wickerman";
|
||||||
|
WickermanFireResistMultiplier = config.Bind(wickerman, "Fire Resist Multiplier", 0.5f,
|
||||||
|
new ConfigDescription("Multiplies incoming fire damage, tier 3+ (full immunity replaces this at tier 8+).", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
PoisonResistMultiplier = config.Bind(wickerman, "Poison Resist Multiplier", 0.5f,
|
||||||
|
new ConfigDescription("Multiplies incoming poison damage, tier 3+ and tier 8+.", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
FireArrowMinDamage = config.Bind(wickerman, "Fire Arrow Min Damage", 22f,
|
||||||
|
new ConfigDescription("Minimum fire damage added to bow attacks, tier 3+.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
|
||||||
|
const string graveRobber = "Furling - Grave Robber";
|
||||||
|
TrophyDropMultiplier = config.Bind(graveRobber, "Trophy Drop Multiplier", 2f,
|
||||||
|
new ConfigDescription("Multiplies trophy drop counts from non-boss kills within range, tier 5+.", new AcceptableValueRange<float>(1f, 5f)));
|
||||||
|
TrophyDoublingRadius = config.Bind(graveRobber, "Trophy Doubling Radius", 25f,
|
||||||
|
new ConfigDescription("Meters from the player a kill must be within for its trophy drops to be doubled.", new AcceptableValueRange<float>(1f, 100f)));
|
||||||
|
CoinsPerStarMin = config.Bind(graveRobber, "Coins Per Star Min", 1,
|
||||||
|
new ConfigDescription("Minimum bonus coins dropped, per star the kill had.", new AcceptableValueRange<int>(0, 50)));
|
||||||
|
CoinsPerStarMax = config.Bind(graveRobber, "Coins Per Star Max", 25,
|
||||||
|
new ConfigDescription("Maximum bonus coins dropped, per star the kill had.", new AcceptableValueRange<int>(0, 100)));
|
||||||
|
|
||||||
|
const string kingIsDead = "Furling - The King Is Dead";
|
||||||
|
PlainsSkillXPMultiplier = config.Bind(kingIsDead, "Plains Skill XP Multiplier", 2f,
|
||||||
|
new ConfigDescription("Multiplies XP gain for every skill while standing in the Plains biome, tier 6+.", new AcceptableValueRange<float>(0.5f, 5f)));
|
||||||
|
|
||||||
|
const string mist = "Furling - In the Mist";
|
||||||
|
EitrFoodDigestionSlowdown = config.Bind(mist, "Eitr Food Digestion Slowdown", 0.5f,
|
||||||
|
new ConfigDescription("Fraction of normal speed at which eitr (blue) food is consumed, tier 7+ (0.5 = lasts twice as long).", new AcceptableValueRange<float>(0.1f, 1f)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -136,7 +136,7 @@ namespace RacesOfValheim
|
||||||
hit.m_damage.m_pierce > 0 || hit.m_damage.m_chop > 0 ||
|
hit.m_damage.m_pierce > 0 || hit.m_damage.m_chop > 0 ||
|
||||||
hit.m_damage.m_pickaxe > 0)
|
hit.m_damage.m_pickaxe > 0)
|
||||||
{
|
{
|
||||||
hit.m_damage.m_fire = Mathf.Max(hit.m_damage.m_fire, 10f);
|
hit.m_damage.m_fire = Mathf.Max(hit.m_damage.m_fire, FurlingConfig.IgniteOnHitMinFireDamage.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "RacesOfValheim",
|
"name": "RacesOfValheim",
|
||||||
"description": "A Valheim mod that adds nine custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Trenta, Trol) each with unique abilities, traits, and a deep boss-driven progression system.",
|
"description": "A Valheim mod that adds nine custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Trenta, Trol) each with unique abilities, traits, and a deep boss-driven progression system.",
|
||||||
"version_number": "1.3.12",
|
"version_number": "1.4.0",
|
||||||
"website_url": "",
|
"website_url": "",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"denikson-BepInExPack_Valheim-5.4.2333",
|
"denikson-BepInExPack_Valheim-5.4.2333",
|
||||||
|
|
|
||||||
|
|
@ -109,10 +109,10 @@ namespace RacesOfValheim
|
||||||
sb.AppendLine($"[Bonemass Unlock] Kin of the Traders (Passive): Haldor and Hildir know their own. Their prices drop by {rules.TraderBuyDiscount * 100f:0}% for you, and what they pay for your trophies and hunting rewards rises by {rules.TraderSellBonus * 100f:0}%.\n");
|
sb.AppendLine($"[Bonemass Unlock] Kin of the Traders (Passive): Haldor and Hildir know their own. Their prices drop by {rules.TraderBuyDiscount * 100f:0}% for you, and what they pay for your trophies and hunting rewards rises by {rules.TraderSellBonus * 100f:0}%.\n");
|
||||||
|
|
||||||
if (rules.RunicPing)
|
if (rules.RunicPing)
|
||||||
sb.AppendLine($"[Yagluth Unlock] Runic Ping ('{DvergarConfig.RunicPingKey}' Key): Spend {DvergarConfig.RunicPingEitrCost:0} eitr to send a pulse through the stone. For {DvergarConfig.RunicPingDuration:0} seconds every ore vein and every hidden enemy within {DvergarConfig.RunicPingRadius:0} meters is lit for you alone.\n");
|
sb.AppendLine($"[Yagluth Unlock] Runic Ping ('{DvergarConfigManagement.RunicPingKey.Value}' Key): Spend {DvergarConfig.RunicPingEitrCost:0} eitr to send a pulse through the stone. For {DvergarConfig.RunicPingDuration:0} seconds every ore vein and every hidden enemy within {DvergarConfig.RunicPingRadius:0} meters is lit for you alone.\n");
|
||||||
|
|
||||||
if (rules.RunicOvercharge)
|
if (rules.RunicOvercharge)
|
||||||
sb.AppendLine($"[Fader Unlock] Runic Overcharge ('{DvergarConfig.RunicOverchargeKey}' Key): Spend {DvergarConfig.RunicOverchargeEitrCost:0} eitr to load the runes. Your next blow with a favoured weapon lands with {DvergarConfig.RunicOverchargeMultiplier:0}x its weight. Hold the charge no longer than {DvergarConfig.RunicOverchargeWindow:0} seconds or it bleeds away.\n");
|
sb.AppendLine($"[Fader Unlock] Runic Overcharge ('{DvergarConfigManagement.RunicOverchargeKey.Value}' Key): Spend {DvergarConfig.RunicOverchargeEitrCost:0} eitr to load the runes. Your next blow with a favoured weapon lands with {DvergarConfig.RunicOverchargeMultiplier:0}x its weight. Hold the charge no longer than {DvergarConfig.RunicOverchargeWindow:0} seconds or it bleeds away.\n");
|
||||||
|
|
||||||
knownTexts["Dvergar Secrets"] = sb.ToString();
|
knownTexts["Dvergar Secrets"] = sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
public const string PluginGUID = "com.nandor.racesofvalheim";
|
public const string PluginGUID = "com.nandor.racesofvalheim";
|
||||||
public const string PluginName = "Races Of Valheim";
|
public const string PluginName = "Races Of Valheim";
|
||||||
public const string PluginVersion = "1.3.12";
|
public const string PluginVersion = "1.4.0";
|
||||||
|
|
||||||
private readonly Harmony harmony = new Harmony(PluginGUID);
|
private readonly Harmony harmony = new Harmony(PluginGUID);
|
||||||
|
|
||||||
|
|
@ -24,6 +24,18 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
private void Awake() {
|
private void Awake() {
|
||||||
Instance = this;
|
Instance = this;
|
||||||
|
// Bound in alphabetical order by race, since Configuration Manager's category list
|
||||||
|
// follows bind order rather than sorting itself - confirmed from the Skadi/Aswid
|
||||||
|
// ordering in-game. Keep new races' Bind() calls slotted in alphabetically here.
|
||||||
|
AswidConfig.Bind(Config);
|
||||||
|
DraughConfig.Bind(Config);
|
||||||
|
DvergarConfigManagement.Bind(Config);
|
||||||
|
FenrirConfig.Bind(Config);
|
||||||
|
FurlingConfig.Bind(Config);
|
||||||
|
SkadiConfig.Bind(Config);
|
||||||
|
SkeletonConfig.Bind(Config);
|
||||||
|
TrentaConfigManagement.Bind(Config);
|
||||||
|
TrolConfig.Bind(Config);
|
||||||
harmony.PatchAll();
|
harmony.PatchAll();
|
||||||
gameObject.AddComponent<FenrirRace>();
|
gameObject.AddComponent<FenrirRace>();
|
||||||
gameObject.AddComponent<SkadiRace>();
|
gameObject.AddComponent<SkadiRace>();
|
||||||
|
|
|
||||||
|
|
@ -60,24 +60,26 @@ namespace RacesOfValheim
|
||||||
return live != null && live.Form == formRules.Form && live.CanAttackInForm;
|
return live != null && live.Form == formRules.Form && live.CanAttackInForm;
|
||||||
}
|
}
|
||||||
|
|
||||||
private const float ATTACK_COOLDOWN = 3f;
|
// Read from SkadiConfig (BepInEx Config) rather than fixed constants, so dragon-form
|
||||||
|
// attacks can be retuned from Configuration Manager - see CONFIGURATION-MANAGER-HOWTO.md.
|
||||||
|
private static float ATTACK_COOLDOWN => SkadiConfig.FormAttackCooldown.Value;
|
||||||
|
|
||||||
// Ranged volleys charge per projectile rather than a flat fee, so the 20- and 60-shard
|
// Ranged volleys charge per projectile rather than a flat fee, so the 20- and 60-shard
|
||||||
// breaths cost what they are worth instead of the same as a three-shard drake spit.
|
// breaths cost what they are worth instead of the same as a three-shard drake spit.
|
||||||
// Stamina rather than eitr, for the same reason the Cold Spell uses it: eitr food only
|
// Stamina rather than eitr, for the same reason the Cold Spell uses it: eitr food only
|
||||||
// exists from the Mistlands on, while the drake form arrives at the Elder, so an eitr
|
// exists from the Mistlands on, while the drake form arrives at the Elder, so an eitr
|
||||||
// cost left the earliest dragon tiers with no attack they could actually pay for.
|
// cost left the earliest dragon tiers with no attack they could actually pay for.
|
||||||
private const float STAMINA_PER_PROJECTILE = 1.5f;
|
private static float STAMINA_PER_PROJECTILE => SkadiConfig.StaminaPerProjectile.Value;
|
||||||
// Ceiling so the widest breath stays castable: 60 shards would otherwise ask 90 stamina.
|
// Ceiling so the widest breath stays castable: 60 shards would otherwise ask 90 stamina.
|
||||||
private const float MAX_VOLLEY_STAMINA = 85f;
|
private static float MAX_VOLLEY_STAMINA => SkadiConfig.MaxVolleyStamina.Value;
|
||||||
|
|
||||||
// Melee costs nothing at all - it is the baseline attack that has to work at every tier,
|
// Melee costs nothing at all - it is the baseline attack that has to work at every tier,
|
||||||
// including the long stretch where the player has no eitr whatsoever.
|
// including the long stretch where the player has no eitr whatsoever.
|
||||||
private const float MELEE_RADIUS = 3f;
|
private static float MELEE_RADIUS => SkadiConfig.MeleeRadius.Value;
|
||||||
private const float MODER_MELEE_DAMAGE = 90f;
|
private static float MODER_MELEE_DAMAGE => SkadiConfig.ModerMeleeDamage.Value;
|
||||||
private const float FADER_MELEE_DAMAGE = 120f;
|
private static float FADER_MELEE_DAMAGE => SkadiConfig.FaderMeleeDamage.Value;
|
||||||
private const float FADER_SPIN_DAMAGE = 100f;
|
private static float FADER_SPIN_DAMAGE => SkadiConfig.FaderSpinDamage.Value;
|
||||||
private const float FADER_SPIN_RADIUS = 5f;
|
private static float FADER_SPIN_RADIUS => SkadiConfig.FaderSpinRadius.Value;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
|
|
@ -93,8 +95,8 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
if (Player.m_localPlayer == null || Player.m_localPlayer.IsDead()) return;
|
if (Player.m_localPlayer == null || Player.m_localPlayer.IsDead()) return;
|
||||||
|
|
||||||
// Handle Flight Toggle (RMB) - Disabled for Fader
|
// Handle Flight Toggle (Right Mouse by default, rebindable) - Disabled for Fader
|
||||||
if (RaceInput.Allowed && Input.GetMouseButtonDown(1) && formRules != null && formRules.Form != SkadiProgression.FormType.SkeletonDragon)
|
if (RaceInput.Allowed && SkadiConfig.FlightToggleKey.Value.IsDown() && formRules != null && formRules.Form != SkadiProgression.FormType.SkeletonDragon)
|
||||||
{
|
{
|
||||||
if (!isFlying && !isLanding)
|
if (!isFlying && !isLanding)
|
||||||
{
|
{
|
||||||
|
|
@ -148,24 +150,26 @@ namespace RacesOfValheim
|
||||||
anim.SetFloat("forward_speed", speed);
|
anim.SetFloat("forward_speed", speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle Attack
|
// Handle Attack - each trigger is a rebindable SkadiConfig keybind; the button id
|
||||||
|
// passed into PerformAttackCoroutine (0/1/2) still selects which attack runs, exactly
|
||||||
|
// as it did when these were raw mouse-button checks.
|
||||||
if (CanAttackNow() && RaceInput.Allowed)
|
if (CanAttackNow() && RaceInput.Allowed)
|
||||||
{
|
{
|
||||||
if (Input.GetMouseButtonDown(0))
|
if (SkadiConfig.PrimaryAttackKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
if (HasAttackForButton(0) && Time.time - lastAttackTime >= ATTACK_COOLDOWN)
|
if (HasAttackForButton(0) && Time.time - lastAttackTime >= ATTACK_COOLDOWN)
|
||||||
{
|
{
|
||||||
StartCoroutine(PerformAttackCoroutine(0));
|
StartCoroutine(PerformAttackCoroutine(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Input.GetMouseButtonDown(2)) // MMB
|
else if (SkadiConfig.BreathAttackKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
if (Time.time - lastAttackTime >= ATTACK_COOLDOWN)
|
if (Time.time - lastAttackTime >= ATTACK_COOLDOWN)
|
||||||
{
|
{
|
||||||
StartCoroutine(PerformAttackCoroutine(2));
|
StartCoroutine(PerformAttackCoroutine(2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Input.GetMouseButtonDown(1) && formRules.Form == SkadiProgression.FormType.SkeletonDragon) // RMB for Fader Spin
|
else if (SkadiConfig.SpinAttackKey.Value.IsDown() && formRules.Form == SkadiProgression.FormType.SkeletonDragon) // Fader Spin
|
||||||
{
|
{
|
||||||
if (Time.time - lastAttackTime >= ATTACK_COOLDOWN)
|
if (Time.time - lastAttackTime >= ATTACK_COOLDOWN)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
179
JotunnModStub/Skadi/SkadiConfig.cs
Normal file
179
JotunnModStub/Skadi/SkadiConfig.cs
Normal file
|
|
@ -0,0 +1,179 @@
|
||||||
|
using UnityEngine;
|
||||||
|
using BepInEx.Configuration;
|
||||||
|
|
||||||
|
namespace RacesOfValheim
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Every tunable number and keybind behind Skadi's abilities and special attacks, bound as
|
||||||
|
/// BepInEx ConfigEntry so they show up in Configuration Manager without touching code - see
|
||||||
|
/// CONFIGURATION-MANAGER-HOWTO.md. Bound once, from RacesOfValheim.Awake().
|
||||||
|
///
|
||||||
|
/// One section per sub-group (rather than everything under one "Skadi" section) so each shows
|
||||||
|
/// up as its own entry in Configuration Manager's category list - collapsing them into a
|
||||||
|
/// single section made that list disappear. Keybinds is bound first, before its section
|
||||||
|
/// otherwise sorts alphabetically among the rest, since it is the group most worth reaching
|
||||||
|
/// quickly; within it every entry carries an explicit Order (Configuration Manager otherwise
|
||||||
|
/// sorts a section's own entries alphabetically) so it reads attack -> cast -> breath -> spin
|
||||||
|
/// -> flight -> the three transform keys, the order abilities actually chain in a fight,
|
||||||
|
/// rather than alphabetically.
|
||||||
|
/// </summary>
|
||||||
|
public static class SkadiConfig
|
||||||
|
{
|
||||||
|
// ─── Keybinds ──────────────────────────────────────────────────────────
|
||||||
|
// Defaults match today's fixed inputs exactly, so nobody's controls change until they
|
||||||
|
// open Configuration Manager (or the .cfg) and rebind one on purpose.
|
||||||
|
public static ConfigEntry<KeyboardShortcut> PrimaryAttackKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> ColdSpellKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> BreathAttackKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> SpinAttackKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> FlightToggleKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> DrakeFormKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> ModerFormKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> FaderFormKey;
|
||||||
|
|
||||||
|
// ─── Cold Spell (human form) ─────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> SpellStaminaCost;
|
||||||
|
public static ConfigEntry<float> SpellCooldown;
|
||||||
|
public static ConfigEntry<float> ImprovedSpellCooldown;
|
||||||
|
public static ConfigEntry<float> SpellBaseDamage;
|
||||||
|
public static ConfigEntry<float> SpellDamagePerState;
|
||||||
|
public static ConfigEntry<int> ImprovedSpellShards;
|
||||||
|
public static ConfigEntry<float> ImprovedSpellDamageBudget;
|
||||||
|
|
||||||
|
// ─── Frost Aura (tier 7+ passive) ───────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> AuraRadius;
|
||||||
|
public static ConfigEntry<float> AuraDamagePerTick;
|
||||||
|
public static ConfigEntry<float> AuraTickInterval;
|
||||||
|
|
||||||
|
// ─── Passive combat ──────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> BonusFrostDamagePerState;
|
||||||
|
|
||||||
|
// ─── Dragon forms: scale ─────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> DrakeScale;
|
||||||
|
public static ConfigEntry<float> ModerScale;
|
||||||
|
public static ConfigEntry<float> FaderScale;
|
||||||
|
|
||||||
|
// ─── Dragon forms: attacks ────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> FormAttackCooldown;
|
||||||
|
public static ConfigEntry<float> StaminaPerProjectile;
|
||||||
|
public static ConfigEntry<float> MaxVolleyStamina;
|
||||||
|
public static ConfigEntry<float> MeleeRadius;
|
||||||
|
public static ConfigEntry<float> ModerMeleeDamage;
|
||||||
|
public static ConfigEntry<float> FaderMeleeDamage;
|
||||||
|
public static ConfigEntry<float> FaderSpinDamage;
|
||||||
|
public static ConfigEntry<float> FaderSpinRadius;
|
||||||
|
|
||||||
|
// ─── Directed flight (Drake/Moder) ────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> FlightTurnSpeed;
|
||||||
|
public static ConfigEntry<float> FlightGlideSpeed;
|
||||||
|
public static ConfigEntry<float> FlightBoostSpeed;
|
||||||
|
public static ConfigEntry<float> FlightSprintSpeed;
|
||||||
|
public static ConfigEntry<float> FlightReverseSpeed;
|
||||||
|
public static ConfigEntry<float> FlightLiftoffSpeed;
|
||||||
|
public static ConfigEntry<float> FlightHoverSeconds;
|
||||||
|
public static ConfigEntry<float> FlightSprintStaminaPerSecond;
|
||||||
|
|
||||||
|
public static void Bind(ConfigFile config)
|
||||||
|
{
|
||||||
|
// Bound first, and ahead of everything else in the file, in case Configuration
|
||||||
|
// Manager's category list preserves bind order rather than sorting sections
|
||||||
|
// alphabetically - either way, the keybinds themselves still land in the requested
|
||||||
|
// order via the explicit Order below, which is guaranteed.
|
||||||
|
const string keybinds = "Skadi - Keybinds";
|
||||||
|
int keyOrder = 8;
|
||||||
|
PrimaryAttackKey = config.Bind(keybinds, "Dragon Primary Attack", new KeyboardShortcut(KeyCode.Mouse0),
|
||||||
|
KeyDesc("Bite/claw attack in any dragon form.", keyOrder--));
|
||||||
|
ColdSpellKey = config.Bind(keybinds, "Cold Spell Cast", new KeyboardShortcut(KeyCode.Mouse2),
|
||||||
|
KeyDesc("Casts the Cold Spell in human form, tier 1+.", keyOrder--));
|
||||||
|
BreathAttackKey = config.Bind(keybinds, "Dragon Breath Attack", new KeyboardShortcut(KeyCode.Mouse2),
|
||||||
|
KeyDesc("Ranged breath/barrage attack in Moder and Skeleton Dragon form.", keyOrder--));
|
||||||
|
SpinAttackKey = config.Bind(keybinds, "Fader Spin Attack", new KeyboardShortcut(KeyCode.Mouse1),
|
||||||
|
KeyDesc("360-degree spin attack, Skeleton Dragon form only.", keyOrder--));
|
||||||
|
FlightToggleKey = config.Bind(keybinds, "Flight Toggle", new KeyboardShortcut(KeyCode.Mouse1),
|
||||||
|
KeyDesc("Takes off or lands while in Drake or Moder form.", keyOrder--));
|
||||||
|
DrakeFormKey = config.Bind(keybinds, "Drake Form", new KeyboardShortcut(KeyCode.G),
|
||||||
|
KeyDesc("Transform into (or revert from) the Drake, tier 3+.", keyOrder--));
|
||||||
|
ModerFormKey = config.Bind(keybinds, "Moder Form", new KeyboardShortcut(KeyCode.H),
|
||||||
|
KeyDesc("Transform into (or revert from) Moder, tier 5+.", keyOrder--));
|
||||||
|
FaderFormKey = config.Bind(keybinds, "Fader Form", new KeyboardShortcut(KeyCode.J),
|
||||||
|
KeyDesc("Transform into (or revert from) the Skeleton Dragon, tier 8.", keyOrder--));
|
||||||
|
|
||||||
|
const string combat = "Skadi - Passive Combat";
|
||||||
|
BonusFrostDamagePerState = config.Bind(combat, "Bonus Frost Damage Per State", 2f,
|
||||||
|
new ConfigDescription("Flat frost damage added to every hit the player lands, multiplied by the current progression state.", new AcceptableValueRange<float>(0f, 10f)));
|
||||||
|
|
||||||
|
const string spell = "Skadi - Cold Spell";
|
||||||
|
SpellStaminaCost = config.Bind(spell, "Stamina Cost", 20f,
|
||||||
|
new ConfigDescription("Stamina spent per cast.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
SpellCooldown = config.Bind(spell, "Cooldown", 1.5f,
|
||||||
|
new ConfigDescription("Seconds between casts before the improved (tier 6+) cast unlocks.", new AcceptableValueRange<float>(0.1f, 10f)));
|
||||||
|
ImprovedSpellCooldown = config.Bind(spell, "Improved Cooldown", 4f,
|
||||||
|
new ConfigDescription("Seconds between casts once the improved cast unlocks (tier 6+) - a burst rather than rapid-fire.", new AcceptableValueRange<float>(0.1f, 15f)));
|
||||||
|
SpellBaseDamage = config.Bind(spell, "Base Damage", 15f,
|
||||||
|
new ConfigDescription("Frost damage at progression state 0, before the per-state bonus.", new AcceptableValueRange<float>(0f, 200f)));
|
||||||
|
SpellDamagePerState = config.Bind(spell, "Damage Per Progression State", 8f,
|
||||||
|
new ConfigDescription("Extra frost damage added per boss progression state (0-8).", new AcceptableValueRange<float>(0f, 50f)));
|
||||||
|
ImprovedSpellShards = config.Bind(spell, "Improved Shard Count", 10,
|
||||||
|
new ConfigDescription("Number of shards the improved (tier 6+) cast splits into.", new AcceptableValueRange<int>(1, 30)));
|
||||||
|
ImprovedSpellDamageBudget = config.Bind(spell, "Improved Damage Budget", 1.6f,
|
||||||
|
new ConfigDescription("Total damage of an improved cast, as a multiple of one normal cast, before it is split across shards.", new AcceptableValueRange<float>(0.5f, 5f)));
|
||||||
|
|
||||||
|
const string aura = "Skadi - Frost Aura";
|
||||||
|
AuraRadius = config.Bind(aura, "Radius", 3f,
|
||||||
|
new ConfigDescription("Meters from the player that the tier 7+ aura damages.", new AcceptableValueRange<float>(1f, 15f)));
|
||||||
|
AuraDamagePerTick = config.Bind(aura, "Damage Per Tick", 10f,
|
||||||
|
new ConfigDescription("Frost damage dealt to every enemy in range, once per tick.", new AcceptableValueRange<float>(0f, 50f)));
|
||||||
|
AuraTickInterval = config.Bind(aura, "Tick Interval", 1f,
|
||||||
|
new ConfigDescription("Seconds between aura damage ticks.", new AcceptableValueRange<float>(0.1f, 5f)));
|
||||||
|
|
||||||
|
const string scale = "Skadi - Dragon Form Scale";
|
||||||
|
DrakeScale = config.Bind(scale, "Drake Scale", 0.9f,
|
||||||
|
new ConfigDescription("Model scale while transformed into the Drake (tier 3-4).", new AcceptableValueRange<float>(0.1f, 2f)));
|
||||||
|
ModerScale = config.Bind(scale, "Moder Scale", 0.5f,
|
||||||
|
new ConfigDescription("Model scale while transformed into Moder (tier 5-7).", new AcceptableValueRange<float>(0.1f, 2f)));
|
||||||
|
FaderScale = config.Bind(scale, "Fader Scale", 0.55f,
|
||||||
|
new ConfigDescription("Model scale while transformed into the Skeleton Dragon (tier 8).", new AcceptableValueRange<float>(0.1f, 2f)));
|
||||||
|
|
||||||
|
const string attacks = "Skadi - Dragon Form Attacks";
|
||||||
|
FormAttackCooldown = config.Bind(attacks, "Attack Cooldown", 3f,
|
||||||
|
new ConfigDescription("Seconds between attacks in any dragon form.", new AcceptableValueRange<float>(0.5f, 15f)));
|
||||||
|
StaminaPerProjectile = config.Bind(attacks, "Stamina Per Projectile", 1.5f,
|
||||||
|
new ConfigDescription("Stamina charged per shard/projectile in a ranged volley.", new AcceptableValueRange<float>(0f, 10f)));
|
||||||
|
MaxVolleyStamina = config.Bind(attacks, "Max Volley Stamina", 85f,
|
||||||
|
new ConfigDescription("Stamina ceiling for a single volley, so the widest breath (60 shards) stays castable.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
MeleeRadius = config.Bind(attacks, "Melee Radius", 3f,
|
||||||
|
new ConfigDescription("Hit-sweep radius for bite/claw attacks (Moder and Fader).", new AcceptableValueRange<float>(1f, 15f)));
|
||||||
|
ModerMeleeDamage = config.Bind(attacks, "Moder Melee Damage", 90f,
|
||||||
|
new ConfigDescription("Base damage of Moder's bite/claw attacks, before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 500f)));
|
||||||
|
FaderMeleeDamage = config.Bind(attacks, "Fader Melee Damage", 120f,
|
||||||
|
new ConfigDescription("Base damage of the Skeleton Dragon's bite/claw attacks, before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 500f)));
|
||||||
|
FaderSpinDamage = config.Bind(attacks, "Fader Spin Damage", 100f,
|
||||||
|
new ConfigDescription("Base damage of the Skeleton Dragon's 360-degree spin attack.", new AcceptableValueRange<float>(0f, 500f)));
|
||||||
|
FaderSpinRadius = config.Bind(attacks, "Fader Spin Radius", 5f,
|
||||||
|
new ConfigDescription("Hit-sweep radius for the Skeleton Dragon's spin attack.", new AcceptableValueRange<float>(1f, 15f)));
|
||||||
|
|
||||||
|
const string flight = "Skadi - Directed Flight";
|
||||||
|
FlightTurnSpeed = config.Bind(flight, "Turn Speed", 120f,
|
||||||
|
new ConfigDescription("Degrees per second the dragon form turns to face its heading.", new AcceptableValueRange<float>(10f, 360f)));
|
||||||
|
FlightGlideSpeed = config.Bind(flight, "Glide Speed", 5f,
|
||||||
|
new ConfigDescription("Speed while gliding unpowered (no W/S held).", new AcceptableValueRange<float>(0f, 30f)));
|
||||||
|
FlightBoostSpeed = config.Bind(flight, "Boost Speed", 12f,
|
||||||
|
new ConfigDescription("Speed while holding W without sprinting.", new AcceptableValueRange<float>(0f, 50f)));
|
||||||
|
FlightSprintSpeed = config.Bind(flight, "Sprint Speed", 22f,
|
||||||
|
new ConfigDescription("Speed while holding W and Shift, stamina permitting.", new AcceptableValueRange<float>(0f, 60f)));
|
||||||
|
FlightReverseSpeed = config.Bind(flight, "Reverse Speed", 7f,
|
||||||
|
new ConfigDescription("Speed while beating backwards (S).", new AcceptableValueRange<float>(0f, 30f)));
|
||||||
|
FlightLiftoffSpeed = config.Bind(flight, "Liftoff Speed", 9f,
|
||||||
|
new ConfigDescription("Climb speed while clawing out of water.", new AcceptableValueRange<float>(0f, 30f)));
|
||||||
|
FlightHoverSeconds = config.Bind(flight, "Hover Seconds", 5f,
|
||||||
|
new ConfigDescription("How long level flight holds altitude after the last powered input before it starts to sink.", new AcceptableValueRange<float>(0f, 30f)));
|
||||||
|
FlightSprintStaminaPerSecond = config.Bind(flight, "Sprint Stamina Per Second", 15f,
|
||||||
|
new ConfigDescription("Stamina drained per second while the sprint speed is actually granted.", new AcceptableValueRange<float>(0f, 60f)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ConfigDescription KeyDesc(string description, int order)
|
||||||
|
{
|
||||||
|
return new ConfigDescription(description, null, new ConfigurationManagerAttributes { Order = order });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -229,7 +229,7 @@ namespace RacesOfValheim
|
||||||
var rules = SkadiProgression.GetRules(BossProgressionManager.GetCurrentProgressionState());
|
var rules = SkadiProgression.GetRules(BossProgressionManager.GetCurrentProgressionState());
|
||||||
if (rules.BonusFrostDamage)
|
if (rules.BonusFrostDamage)
|
||||||
{
|
{
|
||||||
hit.m_damage.m_frost += 2f * BossProgressionManager.GetCurrentProgressionState();
|
hit.m_damage.m_frost += SkadiConfig.BonusFrostDamagePerState.Value * BossProgressionManager.GetCurrentProgressionState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -250,17 +250,19 @@ namespace RacesOfValheim
|
||||||
[HarmonyPatch(typeof(Character), "UpdateFlying")]
|
[HarmonyPatch(typeof(Character), "UpdateFlying")]
|
||||||
public static class SkadiDirectedFlightPatch
|
public static class SkadiDirectedFlightPatch
|
||||||
{
|
{
|
||||||
private const float TURN_SPEED = 120f;
|
// Read from SkadiConfig (BepInEx Config) rather than fixed constants, so flight can be
|
||||||
private const float GLIDE_SPEED = 5f;
|
// retuned from Configuration Manager - see CONFIGURATION-MANAGER-HOWTO.md.
|
||||||
private const float BOOST_SPEED = 12f;
|
private static float TURN_SPEED => SkadiConfig.FlightTurnSpeed.Value;
|
||||||
private const float SPRINT_SPEED = 22f;
|
private static float GLIDE_SPEED => SkadiConfig.FlightGlideSpeed.Value;
|
||||||
private const float REVERSE_SPEED = 7f;
|
private static float BOOST_SPEED => SkadiConfig.FlightBoostSpeed.Value;
|
||||||
|
private static float SPRINT_SPEED => SkadiConfig.FlightSprintSpeed.Value;
|
||||||
|
private static float REVERSE_SPEED => SkadiConfig.FlightReverseSpeed.Value;
|
||||||
// Climbing out of water is deliberately slower than a powered climb in open air - the
|
// Climbing out of water is deliberately slower than a powered climb in open air - the
|
||||||
// wings are dragging themselves free, not racing.
|
// wings are dragging themselves free, not racing.
|
||||||
private const float LIFTOFF_SPEED = 9f;
|
private static float LIFTOFF_SPEED => SkadiConfig.FlightLiftoffSpeed.Value;
|
||||||
private const float HOVER_SECONDS = 5f;
|
private static float HOVER_SECONDS => SkadiConfig.FlightHoverSeconds.Value;
|
||||||
// Per second, drained only while the sprint is actually being granted.
|
// Per second, drained only while the sprint is actually being granted.
|
||||||
private const float SPRINT_STAMINA_PER_SECOND = 15f;
|
private static float SPRINT_STAMINA_PER_SECOND => SkadiConfig.FlightSprintStaminaPerSecond.Value;
|
||||||
// Tangent of the unpowered descent angle: 0.4 sinks at roughly 22 degrees below level.
|
// Tangent of the unpowered descent angle: 0.4 sinks at roughly 22 degrees below level.
|
||||||
private const float DESCENT_SLOPE = 0.4f;
|
private const float DESCENT_SLOPE = 0.4f;
|
||||||
// How much of the aim heading survives the climb out of water. Mostly up, with enough
|
// How much of the aim heading survives the climb out of water. Mostly up, with enough
|
||||||
|
|
@ -465,12 +467,13 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
|
|
||||||
// Valheim binds its own SecondaryAttack action to Middle Mouse, the same button the
|
// Valheim binds its own SecondaryAttack action to Middle Mouse, the same button the
|
||||||
// Cold Spell casts on, so pressing it also swung the unarmed secondary - the kick that
|
// Cold Spell casts on by default, so pressing it also swung the unarmed secondary -
|
||||||
// kept showing up alongside the cast no matter which animation trigger we used. For a
|
// the kick that kept showing up alongside the cast no matter which animation trigger
|
||||||
// Skadi who has the spell, Middle Mouse belongs to the spell. Keyed off the live button
|
// we used. For a Skadi who has the spell, that button belongs to the spell. Keyed off
|
||||||
// state rather than a flag set during our Update, so it does not depend on whether
|
// the live button state (via the configured shortcut, so a rebind stays in sync)
|
||||||
|
// rather than a flag set during our Update, so it does not depend on whether
|
||||||
// PlayerController's FixedUpdate happens to run first.
|
// PlayerController's FixedUpdate happens to run first.
|
||||||
if (secondaryAttack && Input.GetMouseButton(2) &&
|
if (secondaryAttack && SkadiConfig.ColdSpellKey.Value.IsPressed() &&
|
||||||
SkadiRace.Instance != null && SkadiRace.Instance.IsSkadi())
|
SkadiRace.Instance != null && SkadiRace.Instance.IsSkadi())
|
||||||
{
|
{
|
||||||
var rules = SkadiProgression.GetRules(BossProgressionManager.GetCurrentProgressionState());
|
var rules = SkadiProgression.GetRules(BossProgressionManager.GetCurrentProgressionState());
|
||||||
|
|
|
||||||
|
|
@ -27,17 +27,21 @@ namespace RacesOfValheim
|
||||||
// Cold Spell tuning. Damage is 15 + 8 per progression state, so it runs from roughly 31 at
|
// Cold Spell tuning. Damage is 15 + 8 per progression state, so it runs from roughly 31 at
|
||||||
// Eikthyr to 79 at Fader - deliberately a notch under the melee options of the other races
|
// Eikthyr to 79 at Fader - deliberately a notch under the melee options of the other races
|
||||||
// at each tier, which is the trade for hitting at range on a short cooldown.
|
// at each tier, which is the trade for hitting at range on a short cooldown.
|
||||||
|
//
|
||||||
|
// All values below read from SkadiConfig (BepInEx Config, see SkadiConfig.cs) rather than
|
||||||
|
// being fixed constants, so they can be retuned from Configuration Manager without a
|
||||||
|
// rebuild - see CONFIGURATION-MANAGER-HOWTO.md.
|
||||||
public const string SPELL_COOLDOWN_SE = "SE_SkadiSpellCooldown";
|
public const string SPELL_COOLDOWN_SE = "SE_SkadiSpellCooldown";
|
||||||
public const string ATTACK_COOLDOWN_SE = "SE_SkadiAttackCooldown";
|
public const string ATTACK_COOLDOWN_SE = "SE_SkadiAttackCooldown";
|
||||||
|
|
||||||
private const float SPELL_STAMINA_COST = 20f;
|
private static float SPELL_STAMINA_COST => SkadiConfig.SpellStaminaCost.Value;
|
||||||
private const float SPELL_COOLDOWN = 1.5f;
|
private static float SPELL_COOLDOWN => SkadiConfig.SpellCooldown.Value;
|
||||||
private const float IMPROVED_SPELL_COOLDOWN = 4f;
|
private static float IMPROVED_SPELL_COOLDOWN => SkadiConfig.ImprovedSpellCooldown.Value;
|
||||||
private const float SPELL_BASE_DAMAGE = 15f;
|
private static float SPELL_BASE_DAMAGE => SkadiConfig.SpellBaseDamage.Value;
|
||||||
private const float SPELL_DAMAGE_PER_STATE = 8f;
|
private static float SPELL_DAMAGE_PER_STATE => SkadiConfig.SpellDamagePerState.Value;
|
||||||
private const int IMPROVED_SPELL_SHARDS = 10;
|
private static int IMPROVED_SPELL_SHARDS => SkadiConfig.ImprovedSpellShards.Value;
|
||||||
// The improved cast spreads 1.6 casts worth of damage over its shards: wider, not stronger.
|
// The improved cast spreads 1.6 casts worth of damage over its shards: wider, not stronger.
|
||||||
private const float IMPROVED_SPELL_DAMAGE_BUDGET = 1.6f;
|
private static float IMPROVED_SPELL_DAMAGE_BUDGET => SkadiConfig.ImprovedSpellDamageBudget.Value;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
|
|
@ -158,7 +162,7 @@ namespace RacesOfValheim
|
||||||
if (rules.FrostAura)
|
if (rules.FrostAura)
|
||||||
{
|
{
|
||||||
EnsureFrostAuraVFX(true);
|
EnsureFrostAuraVFX(true);
|
||||||
if (Time.time - lastAuraTime >= 1f)
|
if (Time.time - lastAuraTime >= SkadiConfig.AuraTickInterval.Value)
|
||||||
{
|
{
|
||||||
ApplyColdAura();
|
ApplyColdAura();
|
||||||
lastAuraTime = Time.time;
|
lastAuraTime = Time.time;
|
||||||
|
|
@ -217,9 +221,9 @@ namespace RacesOfValheim
|
||||||
if (!RaceInput.Allowed) return;
|
if (!RaceInput.Allowed) return;
|
||||||
|
|
||||||
int state = BossProgressionManager.GetCurrentProgressionState();
|
int state = BossProgressionManager.GetCurrentProgressionState();
|
||||||
if (Input.GetKeyDown(KeyCode.G)) { TryTransformWithRules(SkadiProgression.GetGKeyRules(state)); return; }
|
if (SkadiConfig.DrakeFormKey.Value.IsDown()) { TryTransformWithRules(SkadiProgression.GetGKeyRules(state)); return; }
|
||||||
if (Input.GetKeyDown(KeyCode.H)) { TryTransformWithRules(SkadiProgression.GetHKeyRules(state)); return; }
|
if (SkadiConfig.ModerFormKey.Value.IsDown()) { TryTransformWithRules(SkadiProgression.GetHKeyRules(state)); return; }
|
||||||
if (Input.GetKeyDown(KeyCode.J)) { TryTransformWithRules(SkadiProgression.GetJKeyRules(state)); return; }
|
if (SkadiConfig.FaderFormKey.Value.IsDown()) { TryTransformWithRules(SkadiProgression.GetJKeyRules(state)); return; }
|
||||||
|
|
||||||
// Debug Dump
|
// Debug Dump
|
||||||
if (Input.GetKeyDown(KeyCode.F8))
|
if (Input.GetKeyDown(KeyCode.F8))
|
||||||
|
|
@ -307,8 +311,8 @@ namespace RacesOfValheim
|
||||||
if (Player.m_localPlayer == null || Player.m_localPlayer.IsDead()) return;
|
if (Player.m_localPlayer == null || Player.m_localPlayer.IsDead()) return;
|
||||||
if (isTransformed) return; // Do not cast human spell while in dragon form
|
if (isTransformed) return; // Do not cast human spell while in dragon form
|
||||||
|
|
||||||
// Middle Mouse Button to cast
|
// Middle Mouse Button to cast, by default - rebindable via SkadiConfig.ColdSpellKey.
|
||||||
if (Input.GetMouseButtonDown(2))
|
if (SkadiConfig.ColdSpellKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
// The improved cast is a burst rather than a rapid-fire, so it waits longer.
|
// The improved cast is a burst rather than a rapid-fire, so it waits longer.
|
||||||
float cooldown = rules.ImprovedColdSpell ? IMPROVED_SPELL_COOLDOWN : SPELL_COOLDOWN;
|
float cooldown = rules.ImprovedColdSpell ? IMPROVED_SPELL_COOLDOWN : SPELL_COOLDOWN;
|
||||||
|
|
@ -482,10 +486,10 @@ namespace RacesOfValheim
|
||||||
if (c == Player.m_localPlayer) continue;
|
if (c == Player.m_localPlayer) continue;
|
||||||
if (c.IsTamed() || c.IsPlayer()) continue;
|
if (c.IsTamed() || c.IsPlayer()) continue;
|
||||||
|
|
||||||
if (Vector3.Distance(center, c.transform.position) <= 3f)
|
if (Vector3.Distance(center, c.transform.position) <= SkadiConfig.AuraRadius.Value)
|
||||||
{
|
{
|
||||||
HitData hit = new HitData();
|
HitData hit = new HitData();
|
||||||
hit.m_damage.m_frost = 10f;
|
hit.m_damage.m_frost = SkadiConfig.AuraDamagePerTick.Value;
|
||||||
hit.m_point = c.transform.position;
|
hit.m_point = c.transform.position;
|
||||||
hit.m_dir = (c.transform.position - center).normalized;
|
hit.m_dir = (c.transform.position - center).normalized;
|
||||||
hit.SetAttacker(Player.m_localPlayer);
|
hit.SetAttacker(Player.m_localPlayer);
|
||||||
|
|
@ -525,9 +529,9 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
private Vector3 GetFormScale(SkadiProgression.FormType form)
|
private Vector3 GetFormScale(SkadiProgression.FormType form)
|
||||||
{
|
{
|
||||||
if (form == SkadiProgression.FormType.Moder) return Vector3.one * 0.5f; // Increased to 50%
|
if (form == SkadiProgression.FormType.Moder) return Vector3.one * SkadiConfig.ModerScale.Value;
|
||||||
if (form == SkadiProgression.FormType.SkeletonDragon) return Vector3.one * 0.55f; // 10% larger than Moder
|
if (form == SkadiProgression.FormType.SkeletonDragon) return Vector3.one * SkadiConfig.FaderScale.Value;
|
||||||
return Vector3.one * 0.9f; // Drake (reduced by 10%)
|
return Vector3.one * SkadiConfig.DrakeScale.Value; // Drake
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator TransformRoutine(SkadiProgression.FormRules rules)
|
private IEnumerator TransformRoutine(SkadiProgression.FormRules rules)
|
||||||
|
|
|
||||||
76
JotunnModStub/Skeleton/SkeletonConfig.cs
Normal file
76
JotunnModStub/Skeleton/SkeletonConfig.cs
Normal file
|
|
@ -0,0 +1,76 @@
|
||||||
|
using BepInEx.Configuration;
|
||||||
|
|
||||||
|
namespace RacesOfValheim
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Every tunable number behind the Skeleton's abilities, bound as BepInEx ConfigEntry so they
|
||||||
|
/// show up in Configuration Manager without touching code - see
|
||||||
|
/// CONFIGURATION-MANAGER-HOWTO.md. Bound once, from RacesOfValheim.Awake(). One section per
|
||||||
|
/// topic (matches the other races' layout).
|
||||||
|
///
|
||||||
|
/// No keybinds section: every Skeleton ability is passive, triggered by tier and combat events
|
||||||
|
/// rather than a key press.
|
||||||
|
///
|
||||||
|
/// The per-tier progression table itself (SkeletonProgression.GetRules: max health bonus,
|
||||||
|
/// lifesteal percent per tier, max summons) is left as-is, same boundary drawn for every other
|
||||||
|
/// race's progression table - not exposed here. Only the flat ability numbers a tier's boolean
|
||||||
|
/// flag switches on are configurable.
|
||||||
|
///
|
||||||
|
/// One caveat: Enhanced Regen Health Multiplier is read into SE_SkeletonStats.RebuildForState,
|
||||||
|
/// which only re-reads it when the player's progression state changes (it short-circuits if
|
||||||
|
/// the state matches what it last built for). Retuning that one value mid-session at an
|
||||||
|
/// already-reached tier needs a relog (or reaching a new tier) to take effect. Everything else
|
||||||
|
/// here reads live on every use.
|
||||||
|
/// </summary>
|
||||||
|
public static class SkeletonConfig
|
||||||
|
{
|
||||||
|
// ─── Passive combat ──────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> AutoStunCooldown;
|
||||||
|
public static ConfigEntry<float> AutoStunStaggerMultiplier;
|
||||||
|
public static ConfigEntry<float> PoisonAttackBonus;
|
||||||
|
public static ConfigEntry<float> EnhancedRegenHealthMultiplier;
|
||||||
|
public static ConfigEntry<float> EnhancedRegenTickSpeedBonus;
|
||||||
|
|
||||||
|
// ─── Fire Aura (tier 5+) ───────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> FireAuraRadius;
|
||||||
|
public static ConfigEntry<float> FireAuraDamagePerTick;
|
||||||
|
public static ConfigEntry<float> FireAuraTickInterval;
|
||||||
|
|
||||||
|
// ─── Resurrection (tier 6+) ────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> ResurrectionCooldown;
|
||||||
|
|
||||||
|
// ─── Visuals ───────────────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<bool> HeadFireVFXEnabled;
|
||||||
|
|
||||||
|
public static void Bind(ConfigFile config)
|
||||||
|
{
|
||||||
|
const string combat = "Skeleton - Passive Combat";
|
||||||
|
AutoStunCooldown = config.Bind(combat, "Auto Stun Cooldown", 5f,
|
||||||
|
new ConfigDescription("Seconds between forced staggers on the enemy hit, tier 3+.", new AcceptableValueRange<float>(0f, 60f)));
|
||||||
|
AutoStunStaggerMultiplier = config.Bind(combat, "Auto Stun Stagger Multiplier", 100f,
|
||||||
|
new ConfigDescription("Stagger multiplier applied to force the stagger through.", new AcceptableValueRange<float>(1f, 500f)));
|
||||||
|
PoisonAttackBonus = config.Bind(combat, "Poison Attack Bonus", 20f,
|
||||||
|
new ConfigDescription("Flat poison damage added to every hit the player lands, tier 4+.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
EnhancedRegenHealthMultiplier = config.Bind(combat, "Enhanced Regen Health Multiplier", 1.5f,
|
||||||
|
new ConfigDescription("Health regeneration multiplier, tier 5+.", new AcceptableValueRange<float>(1f, 5f)));
|
||||||
|
EnhancedRegenTickSpeedBonus = config.Bind(combat, "Enhanced Regen Tick Speed Bonus", 0.25f,
|
||||||
|
new ConfigDescription("Extra speed at which the regen timer accumulates, tier 5+ (0.25 = 25% faster ticks).", new AcceptableValueRange<float>(0f, 2f)));
|
||||||
|
|
||||||
|
const string aura = "Skeleton - Fire Aura";
|
||||||
|
FireAuraRadius = config.Bind(aura, "Radius", 5f,
|
||||||
|
new ConfigDescription("Meters from the player that the tier 5+ aura damages.", new AcceptableValueRange<float>(1f, 20f)));
|
||||||
|
FireAuraDamagePerTick = config.Bind(aura, "Damage Per Tick", 30f,
|
||||||
|
new ConfigDescription("Fire damage dealt to every enemy in range, once per tick.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
FireAuraTickInterval = config.Bind(aura, "Tick Interval", 1f,
|
||||||
|
new ConfigDescription("Seconds between aura damage ticks.", new AcceptableValueRange<float>(0.1f, 5f)));
|
||||||
|
|
||||||
|
const string resurrection = "Skeleton - Resurrection";
|
||||||
|
ResurrectionCooldown = config.Bind(resurrection, "Cooldown", 300f,
|
||||||
|
new ConfigDescription("Seconds between auto-resurrections, tier 6+.", new AcceptableValueRange<float>(0f, 3600f)));
|
||||||
|
|
||||||
|
const string visuals = "Skeleton - Visuals";
|
||||||
|
HeadFireVFXEnabled = config.Bind(visuals, "Head Fire VFX Enabled", true,
|
||||||
|
new ConfigDescription("Whether the burning-skull effect (worn from tier 5+) renders at all. A client-side preference: disabling it stops you from seeing it on yourself and on every other skeleton you look at, but does not change what other players see."));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -335,8 +335,8 @@ namespace RacesOfValheim
|
||||||
anim.cullingMode = AnimatorCullingMode.AlwaysAnimate;
|
anim.cullingMode = AnimatorCullingMode.AlwaysAnimate;
|
||||||
}
|
}
|
||||||
|
|
||||||
HideItemInstances(__instance, "m_hairItemInstances");
|
HideItemInstances(__instance, "m_hairItemInstance");
|
||||||
HideItemInstances(__instance, "m_beardItemInstances");
|
HideItemInstances(__instance, "m_beardItemInstance");
|
||||||
SetHelmetVisible(__instance, false);
|
SetHelmetVisible(__instance, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -359,8 +359,8 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowItemInstances(__instance, "m_hairItemInstances");
|
ShowItemInstances(__instance, "m_hairItemInstance");
|
||||||
ShowItemInstances(__instance, "m_beardItemInstances");
|
ShowItemInstances(__instance, "m_beardItemInstance");
|
||||||
SetHelmetVisible(__instance, true);
|
SetHelmetVisible(__instance, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -375,70 +375,61 @@ namespace RacesOfValheim
|
||||||
/// first frame after a race change, all of which reach this postfix and none of which
|
/// first frame after a race change, all of which reach this postfix and none of which
|
||||||
/// reach SkeletonRace.
|
/// reach SkeletonRace.
|
||||||
///
|
///
|
||||||
/// Scaled rather than deactivated, because Valheim re-enables the instance whenever it
|
/// Delegates to SkeletonVisuals.SetEquipmentPieceHidden, which scales the wrapper to
|
||||||
/// refreshes visuals - the approach the Dvergar's hood already proved out.
|
/// zero and disables its renderers - scale alone leaves a skinned piece (bound to the
|
||||||
|
/// player's own bones rather than its own transform) still drawing, which is what a
|
||||||
|
/// helmet with a skinned cloth or chain part looked like.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static void SetHelmetVisible(VisEquipment visEq, bool visible)
|
private static void SetHelmetVisible(VisEquipment visEq, bool visible)
|
||||||
{
|
{
|
||||||
GameObject helmet = Traverse.Create(visEq).Field<GameObject>("m_helmetItemInstance").Value;
|
GameObject helmet = Traverse.Create(visEq).Field<GameObject>("m_helmetItemInstance").Value;
|
||||||
if (helmet == null) return;
|
SkeletonVisuals.SetEquipmentPieceHidden(helmet, !visible);
|
||||||
|
|
||||||
Vector3 wanted = visible ? Vector3.one : Vector3.zero;
|
|
||||||
|
|
||||||
// Only ever undo our own hiding: another race may legitimately be scaling this.
|
|
||||||
if (!visible && helmet.transform.localScale != Vector3.zero)
|
|
||||||
{
|
|
||||||
helmet.transform.localScale = wanted;
|
|
||||||
}
|
|
||||||
else if (visible && helmet.transform.localScale == Vector3.zero)
|
|
||||||
{
|
|
||||||
helmet.transform.localScale = wanted;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void HideItemInstances(VisEquipment visEq, string fieldName)
|
private static void HideItemInstances(VisEquipment visEq, string fieldName)
|
||||||
|
{
|
||||||
|
SetItemInstanceActive(visEq, fieldName, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ShowItemInstances(VisEquipment visEq, string fieldName)
|
||||||
|
{
|
||||||
|
SetItemInstanceActive(visEq, fieldName, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Hair and beard live in VisEquipment as a single GameObject (m_hairItemInstance /
|
||||||
|
/// m_beardItemInstance), the same as the helmet - not a list. A previous version of
|
||||||
|
/// this looked for "m_hairItemInstances" / "m_beardItemInstances" (plural), which do
|
||||||
|
/// not exist on VisEquipment, so the reflection lookup silently found nothing and the
|
||||||
|
/// beard never got the SetActive(false) this was supposed to give it. Handling both
|
||||||
|
/// shapes here matches the defensive pattern the Furling race already uses.
|
||||||
|
/// </summary>
|
||||||
|
private static void SetItemInstanceActive(VisEquipment visEq, string fieldName, bool active)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var field = typeof(VisEquipment).GetField(fieldName, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
var field = typeof(VisEquipment).GetField(fieldName, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
||||||
if (field != null)
|
if (field == null) return;
|
||||||
|
|
||||||
|
object value = field.GetValue(visEq);
|
||||||
|
if (value is GameObject go)
|
||||||
{
|
{
|
||||||
var list = field.GetValue(visEq) as System.Collections.Generic.List<GameObject>;
|
if (go != null) go.SetActive(active);
|
||||||
if (list != null)
|
}
|
||||||
|
else if (value is System.Collections.Generic.List<GameObject> list)
|
||||||
|
{
|
||||||
|
foreach (GameObject item in list)
|
||||||
{
|
{
|
||||||
foreach (GameObject go in list)
|
if (item != null) item.SetActive(active);
|
||||||
{
|
|
||||||
if (go != null) go.SetActive(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (System.Exception e)
|
catch (System.Exception e)
|
||||||
{
|
{
|
||||||
Jotunn.Logger.LogWarning($"Failed to hide {fieldName}: {e.Message}");
|
Jotunn.Logger.LogWarning($"Failed to set {fieldName} active={active}: {e.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ShowItemInstances(VisEquipment visEq, string fieldName)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var field = typeof(VisEquipment).GetField(fieldName, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
|
||||||
if (field != null)
|
|
||||||
{
|
|
||||||
var list = field.GetValue(visEq) as System.Collections.Generic.List<GameObject>;
|
|
||||||
if (list != null)
|
|
||||||
{
|
|
||||||
foreach (GameObject go in list)
|
|
||||||
{
|
|
||||||
if (go != null) go.SetActive(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (System.Exception e) { }
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bones worth reporting on. Not remapped - the player rig has a real 'Jaw' bone and the
|
// Bones worth reporting on. Not remapped - the player rig has a real 'Jaw' bone and the
|
||||||
// name match lands on it correctly, which is exactly why the plain and poison skeletons
|
// name match lands on it correctly, which is exactly why the plain and poison skeletons
|
||||||
// always looked right. An earlier attempt pinned this group to the head instead and
|
// always looked right. An earlier attempt pinned this group to the head instead and
|
||||||
|
|
@ -605,16 +596,16 @@ namespace RacesOfValheim
|
||||||
if (attacker != null && attacker == Player.m_localPlayer && SkeletonRace.IsSkeleton())
|
if (attacker != null && attacker == Player.m_localPlayer && SkeletonRace.IsSkeleton())
|
||||||
{
|
{
|
||||||
// Auto Stun
|
// Auto Stun
|
||||||
if (rules.AutoStunFirstHit && Time.time - lastStunTime > 5f)
|
if (rules.AutoStunFirstHit && Time.time - lastStunTime > SkeletonConfig.AutoStunCooldown.Value)
|
||||||
{
|
{
|
||||||
hit.m_staggerMultiplier = 100f; // Force stagger
|
hit.m_staggerMultiplier = SkeletonConfig.AutoStunStaggerMultiplier.Value; // Force stagger
|
||||||
lastStunTime = Time.time;
|
lastStunTime = Time.time;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Poison Attacks
|
// Poison Attacks
|
||||||
if (rules.PoisonAttacks)
|
if (rules.PoisonAttacks)
|
||||||
{
|
{
|
||||||
hit.m_damage.m_poison += 20f; // Add flat 20 poison damage
|
hit.m_damage.m_poison += SkeletonConfig.PoisonAttackBonus.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lifesteal
|
// Lifesteal
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,87 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// F8 debug: fires a ray from the camera and logs whatever it hits. Cosmetic pieces
|
||||||
|
/// (hair, beard, helmet) carry no collider, so this mostly confirms terrain/creature hits
|
||||||
|
/// - LogHeadCosmeticsState below is what actually answers "what is that floating chunk."
|
||||||
|
/// Kept anyway because it is the general-purpose "what am I looking at" tool for any other
|
||||||
|
/// bone or prefab placement question that comes up later.
|
||||||
|
/// </summary>
|
||||||
|
private void LogRaycastHit()
|
||||||
|
{
|
||||||
|
Camera cam = Camera.main;
|
||||||
|
if (cam == null)
|
||||||
|
{
|
||||||
|
Jotunn.Logger.LogInfo("[F8] No camera found for raycast.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ray ray = new Ray(cam.transform.position, cam.transform.forward);
|
||||||
|
if (Physics.Raycast(ray, out RaycastHit hit, 50f))
|
||||||
|
{
|
||||||
|
Jotunn.Logger.LogInfo("--- F8 RAYCAST HIT ---");
|
||||||
|
Jotunn.Logger.LogInfo($"Collider: '{hit.collider.gameObject.name}' at {hit.point:F2}, distance={hit.distance:F2}");
|
||||||
|
Jotunn.Logger.LogInfo($"Full path: {GetFullPath(hit.collider.transform)}");
|
||||||
|
Renderer renderer = hit.collider.GetComponentInParent<Renderer>();
|
||||||
|
if (renderer != null)
|
||||||
|
{
|
||||||
|
Jotunn.Logger.LogInfo($"Nearest renderer: '{renderer.gameObject.name}' ({renderer.GetType().Name}), enabled={renderer.enabled}, scale={renderer.transform.lossyScale:F3}");
|
||||||
|
}
|
||||||
|
Jotunn.Logger.LogInfo("----------------------");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Jotunn.Logger.LogInfo("[F8] Raycast hit nothing within 50m (cosmetic pieces usually have no collider anyway).");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string GetFullPath(Transform t)
|
||||||
|
{
|
||||||
|
string path = t.name;
|
||||||
|
for (Transform parent = t.parent; parent != null; parent = parent.parent)
|
||||||
|
{
|
||||||
|
path = parent.name + "/" + path;
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// F8 debug: dumps the exact state of the three item slots this race hides (hair, beard,
|
||||||
|
/// helmet) - active flag, renderer enabled flag and scale for every renderer underneath.
|
||||||
|
/// This is the direct answer to "what is still visible and why": a chunk that survives
|
||||||
|
/// hiding will show up here as active=true, or as a renderer with enabled=true even while
|
||||||
|
/// its wrapper is scaled to zero (the skinned-mesh case scale alone cannot hide).
|
||||||
|
/// </summary>
|
||||||
|
private void LogHeadCosmeticsState()
|
||||||
|
{
|
||||||
|
if (Player.m_localPlayer == null) return;
|
||||||
|
VisEquipment vis = Player.m_localPlayer.GetComponent<VisEquipment>();
|
||||||
|
if (vis == null) return;
|
||||||
|
|
||||||
|
Jotunn.Logger.LogInfo("--- F8 SKELETON HEAD COSMETICS ---");
|
||||||
|
DumpItemInstanceField(vis, "m_hairItemInstance");
|
||||||
|
DumpItemInstanceField(vis, "m_beardItemInstance");
|
||||||
|
DumpItemInstanceField(vis, "m_helmetItemInstance");
|
||||||
|
Jotunn.Logger.LogInfo("----------------------------------");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void DumpItemInstanceField(VisEquipment vis, string fieldName)
|
||||||
|
{
|
||||||
|
GameObject go = HarmonyLib.Traverse.Create(vis).Field<GameObject>(fieldName).Value;
|
||||||
|
if (go == null)
|
||||||
|
{
|
||||||
|
Jotunn.Logger.LogInfo($"[F8] {fieldName}: null (nothing equipped/instantiated).");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Jotunn.Logger.LogInfo($"[F8] {fieldName}: '{go.name}' active={go.activeSelf} scale={go.transform.localScale:F3}");
|
||||||
|
foreach (Renderer r in go.GetComponentsInChildren<Renderer>(true))
|
||||||
|
{
|
||||||
|
Jotunn.Logger.LogInfo($"[F8] renderer '{r.gameObject.name}' ({r.GetType().Name}) enabled={r.enabled}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (Input.GetKeyDown(KeyCode.F8))
|
if (Input.GetKeyDown(KeyCode.F8))
|
||||||
|
|
@ -185,6 +266,9 @@ namespace RacesOfValheim
|
||||||
DumpTransformHierarchy(Hud.instance.transform, "");
|
DumpTransformHierarchy(Hud.instance.transform, "");
|
||||||
Jotunn.Logger.LogInfo("--------------------------");
|
Jotunn.Logger.LogInfo("--------------------------");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LogRaycastHit();
|
||||||
|
LogHeadCosmeticsState();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Player.m_localPlayer == null) return;
|
if (Player.m_localPlayer == null) return;
|
||||||
|
|
@ -250,10 +334,7 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
// Hide Helmets (Valheim uses singular GameObject for helmet)
|
// Hide Helmets (Valheim uses singular GameObject for helmet)
|
||||||
var helmetObj = HarmonyLib.Traverse.Create(currentVis).Field<GameObject>("m_helmetItemInstance").Value;
|
var helmetObj = HarmonyLib.Traverse.Create(currentVis).Field<GameObject>("m_helmetItemInstance").Value;
|
||||||
if (helmetObj != null && helmetObj.transform.localScale != Vector3.zero)
|
SkeletonVisuals.SetEquipmentPieceHidden(helmetObj, true);
|
||||||
{
|
|
||||||
helmetObj.transform.localScale = Vector3.zero;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Scale Body Armor (Chest, Legs, Shoulder) by 5%
|
// Scale Body Armor (Chest, Legs, Shoulder) by 5%
|
||||||
string[] armorFields = { "m_chestItemInstances", "m_legItemInstances", "m_shoulderItemInstances" };
|
string[] armorFields = { "m_chestItemInstances", "m_legItemInstances", "m_shoulderItemInstances" };
|
||||||
|
|
@ -355,18 +436,17 @@ namespace RacesOfValheim
|
||||||
// rate, which is the player's own field.
|
// rate, which is the player's own field.
|
||||||
if (rules.EnhancedRegen)
|
if (rules.EnhancedRegen)
|
||||||
{
|
{
|
||||||
// Speed up regen ticks by 20% (1.25x faster timer accumulation)
|
|
||||||
float currentTimer = HarmonyLib.Traverse.Create(Player.m_localPlayer).Field<float>("m_foodRegenTimer").Value;
|
float currentTimer = HarmonyLib.Traverse.Create(Player.m_localPlayer).Field<float>("m_foodRegenTimer").Value;
|
||||||
HarmonyLib.Traverse.Create(Player.m_localPlayer).Field("m_foodRegenTimer").SetValue(currentTimer + Time.deltaTime * 0.25f);
|
HarmonyLib.Traverse.Create(Player.m_localPlayer).Field("m_foodRegenTimer").SetValue(currentTimer + Time.deltaTime * SkeletonConfig.EnhancedRegenTickSpeedBonus.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flames on the skull, worn with the fire-tier model and nothing else.
|
// Flames on the skull, worn with the fire-tier model and nothing else.
|
||||||
headFlame.Apply(Player.m_localPlayer, rules.ModelPrefab == SkeletonProgression.FireModel);
|
headFlame.Apply(Player.m_localPlayer, SkeletonConfig.HeadFireVFXEnabled.Value && rules.ModelPrefab == SkeletonProgression.FireModel);
|
||||||
|
|
||||||
if (rules.FireAura)
|
if (rules.FireAura)
|
||||||
{
|
{
|
||||||
EnsureFireAuraVFX(true);
|
EnsureFireAuraVFX(true);
|
||||||
if (Time.time - lastAuraTime >= 1f)
|
if (Time.time - lastAuraTime >= SkeletonConfig.FireAuraTickInterval.Value)
|
||||||
{
|
{
|
||||||
ApplyFireAura();
|
ApplyFireAura();
|
||||||
lastAuraTime = Time.time;
|
lastAuraTime = Time.time;
|
||||||
|
|
@ -475,10 +555,10 @@ namespace RacesOfValheim
|
||||||
if (Player.m_localPlayer == null) return;
|
if (Player.m_localPlayer == null) return;
|
||||||
|
|
||||||
Vector3 center = Player.m_localPlayer.transform.position;
|
Vector3 center = Player.m_localPlayer.transform.position;
|
||||||
float radius = 5f;
|
float radius = SkeletonConfig.FireAuraRadius.Value;
|
||||||
|
|
||||||
HitData hitData = new HitData();
|
HitData hitData = new HitData();
|
||||||
hitData.m_damage.m_fire = 30f; // 30 fire damage per second
|
hitData.m_damage.m_fire = SkeletonConfig.FireAuraDamagePerTick.Value;
|
||||||
hitData.SetAttacker(Player.m_localPlayer);
|
hitData.SetAttacker(Player.m_localPlayer);
|
||||||
hitData.m_dir = Vector3.zero;
|
hitData.m_dir = Vector3.zero;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ namespace RacesOfValheim
|
||||||
// template: SEMan.AddStatusEffect clones what it is given and adds the clone, so
|
// template: SEMan.AddStatusEffect clones what it is given and adds the clone, so
|
||||||
// anything written to the template afterwards reaches nobody. That is why the Moder
|
// anything written to the template afterwards reaches nobody. That is why the Moder
|
||||||
// regeneration bonus never applied either.
|
// regeneration bonus never applied either.
|
||||||
m_healthRegenMultiplier = rules.EnhancedRegen ? 1.5f : 1.0f;
|
m_healthRegenMultiplier = rules.EnhancedRegen ? SkeletonConfig.EnhancedRegenHealthMultiplier.Value : 1.0f;
|
||||||
|
|
||||||
m_mods = new List<HitData.DamageModPair>
|
m_mods = new List<HitData.DamageModPair>
|
||||||
{
|
{
|
||||||
|
|
@ -64,7 +64,7 @@ namespace RacesOfValheim
|
||||||
m_tooltip = "Your skeletal body is too weak to resurrect again right now.";
|
m_tooltip = "Your skeletal body is too weak to resurrect again right now.";
|
||||||
m_icon = Jotunn.Managers.PrefabManager.Cache.GetPrefab<GameObject>("TrophySkeletonPoison")?.GetComponent<ItemDrop>()?.m_itemData.GetIcon()
|
m_icon = Jotunn.Managers.PrefabManager.Cache.GetPrefab<GameObject>("TrophySkeletonPoison")?.GetComponent<ItemDrop>()?.m_itemData.GetIcon()
|
||||||
?? Jotunn.Managers.PrefabManager.Cache.GetPrefab<GameObject>("TrophySkeleton")?.GetComponent<ItemDrop>()?.m_itemData.GetIcon();
|
?? Jotunn.Managers.PrefabManager.Cache.GetPrefab<GameObject>("TrophySkeleton")?.GetComponent<ItemDrop>()?.m_itemData.GetIcon();
|
||||||
m_ttl = 300f; // 5 minutes
|
m_ttl = SkeletonConfig.ResurrectionCooldown.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,37 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
public static bool IsSkeletonPlayer(Player player) => GetPlayerRace(player) == RaceId;
|
public static bool IsSkeletonPlayer(Player player) => GetPlayerRace(player) == RaceId;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fully hides (or restores) one equipped item instance - a helmet, typically.
|
||||||
|
///
|
||||||
|
/// Scale-to-zero alone leaves skinned pieces behind: a SkinnedMeshRenderer bound to the
|
||||||
|
/// player's own bones (some helmets carry a cloth or chain piece skinned that way) is
|
||||||
|
/// deformed by those bone matrices, not by its GameObject's transform, so zeroing the
|
||||||
|
/// wrapper's localScale does nothing to it - exactly the "part of the helmet is still
|
||||||
|
/// there" artifact reported on the Skeleton. Disabling every Renderer underneath has no
|
||||||
|
/// such exception; combined with the scale it hides both plain and skinned pieces, and
|
||||||
|
/// is reasserted the same way (Valheim's own visual refresh re-enables the instance and
|
||||||
|
/// resets its scale, so both must be redone every time visuals rebuild).
|
||||||
|
/// </summary>
|
||||||
|
public static void SetEquipmentPieceHidden(GameObject instance, bool hidden)
|
||||||
|
{
|
||||||
|
if (instance == null) return;
|
||||||
|
|
||||||
|
Vector3 wantedScale = hidden ? Vector3.zero : Vector3.one;
|
||||||
|
if (instance.transform.localScale != wantedScale)
|
||||||
|
{
|
||||||
|
instance.transform.localScale = wantedScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (Renderer renderer in instance.GetComponentsInChildren<Renderer>(true))
|
||||||
|
{
|
||||||
|
if (renderer.enabled == hidden)
|
||||||
|
{
|
||||||
|
renderer.enabled = !hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The tier a given player's body should be built for. The ZDO carries it so remote
|
/// The tier a given player's body should be built for. The ZDO carries it so remote
|
||||||
/// players render at their own standing; without one - the menu preview - fall back to
|
/// players render at their own standing; without one - the menu preview - fall back to
|
||||||
|
|
@ -182,15 +213,21 @@ namespace RacesOfValheim
|
||||||
light.intensity *= 0.6f;
|
light.intensity *= 0.6f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Anything that made the source a torch rather than a fire.
|
// Allowlist, not a blocklist: keep only what a pure VFX actually needs (the
|
||||||
foreach (MonoBehaviour comp in m_instance.GetComponentsInChildren<MonoBehaviour>(true))
|
// particle systems, their renderers, and the light tweaked above) and destroy
|
||||||
|
// every other component, whatever it turns out to be. A blocklist of "known bad"
|
||||||
|
// types (MonoBehaviour, Collider) missed Rigidbody - not a MonoBehaviour in Unity,
|
||||||
|
// so the old loop never touched it - and a torch's fire-particle node carrying one
|
||||||
|
// meant physics kept acting on the clone independently of m_instance being
|
||||||
|
// repositioned onto the head every frame: it visibly fell away while the empty
|
||||||
|
// parent stayed correctly tracked above it. Anything that made the source a torch
|
||||||
|
// rather than a bare flame - the stick mesh, ItemDrop, durability, all of it -
|
||||||
|
// goes the same way.
|
||||||
|
foreach (Component comp in m_instance.GetComponentsInChildren<Component>(true))
|
||||||
{
|
{
|
||||||
|
if (comp is Transform || comp is ParticleSystem || comp is ParticleSystemRenderer || comp is Light) continue;
|
||||||
Object.Destroy(comp);
|
Object.Destroy(comp);
|
||||||
}
|
}
|
||||||
foreach (Collider col in m_instance.GetComponentsInChildren<Collider>(true))
|
|
||||||
{
|
|
||||||
Object.Destroy(col);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,17 +23,17 @@ namespace RacesOfValheim
|
||||||
// Player.TakeInput, so nothing fires while a map, chest or chat window has focus.
|
// Player.TakeInput, so nothing fires while a map, chest or chat window has focus.
|
||||||
if (!RaceInput.Allowed) return;
|
if (!RaceInput.Allowed) return;
|
||||||
|
|
||||||
if (state >= TrentaConfig.PurpleRainUnlockState && Input.GetKeyDown(TrentaConfig.PurpleRainKey))
|
if (state >= TrentaConfig.PurpleRainUnlockState && TrentaConfigManagement.PurpleRainKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
TryPurpleRain(player);
|
TryPurpleRain(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state >= TrentaConfig.PortalUnlockState && Input.GetKeyDown(TrentaConfig.PortalKey))
|
if (state >= TrentaConfig.PortalUnlockState && TrentaConfigManagement.PortalKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
TryOpenPortal(player);
|
TryOpenPortal(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state >= TrentaConfig.MuspellUnlockState && Input.GetKeyDown(TrentaConfig.MuspellKey))
|
if (state >= TrentaConfig.MuspellUnlockState && TrentaConfigManagement.MuspellKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
TrentaMuspell.Toggle(player);
|
TrentaMuspell.Toggle(player);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,11 +93,12 @@ namespace RacesOfValheim
|
||||||
// Base passive, live from state 1: stand motionless in daylight, out from under a roof,
|
// Base passive, live from state 1: stand motionless in daylight, out from under a roof,
|
||||||
// and the Trenta puts down roots. TrentaAbilities.TickPhotosynthesis reads every number
|
// and the Trenta puts down roots. TrentaAbilities.TickPhotosynthesis reads every number
|
||||||
// below; nothing is hard-coded in the patch itself.
|
// below; nothing is hard-coded in the patch itself.
|
||||||
public const float PhotosynthesisStillnessSeconds = 10f; // channel time before it fires
|
// Forward to TrentaConfigManagement (BepInEx ConfigEntry) - see that class.
|
||||||
public const int PhotosynthesisHealSeconds = 8; // number of 1-second heal ticks
|
public static float PhotosynthesisStillnessSeconds => TrentaConfigManagement.PhotosynthesisStillnessSeconds.Value;
|
||||||
public const float PhotosynthesisHealPercentPerSecond = 0.10f; // % of max health per tick
|
public static int PhotosynthesisHealSeconds => TrentaConfigManagement.PhotosynthesisHealSeconds.Value;
|
||||||
public const float PhotosynthesisRestBaseMinutes = 5f; // Rested duration at Base
|
public static float PhotosynthesisHealPercentPerSecond => TrentaConfigManagement.PhotosynthesisHealPercentPerSecond.Value;
|
||||||
public const float PhotosynthesisRestMinutesPerBoss = 1f; // + this, per boss defeated
|
public static float PhotosynthesisRestBaseMinutes => TrentaConfigManagement.PhotosynthesisRestBaseMinutes.Value;
|
||||||
|
public static float PhotosynthesisRestMinutesPerBoss => TrentaConfigManagement.PhotosynthesisRestMinutesPerBoss.Value;
|
||||||
|
|
||||||
// Character.GetVelocity() never reads exactly zero even standing still - a bit of
|
// Character.GetVelocity() never reads exactly zero even standing still - a bit of
|
||||||
// physics jitter is normal. Below this, the Trenta counts as motionless.
|
// physics jitter is normal. Below this, the Trenta counts as motionless.
|
||||||
|
|
@ -110,16 +111,20 @@ namespace RacesOfValheim
|
||||||
// lines up with RaceHostilityManager's Trenta block (Greyling/Greydwarf/Fuling/Troll/
|
// lines up with RaceHostilityManager's Trenta block (Greyling/Greydwarf/Fuling/Troll/
|
||||||
// Leech/Deathsquito) and with every tamed companion and teammate, for free.
|
// Leech/Deathsquito) and with every tamed companion and teammate, for free.
|
||||||
public const int PurpleRainUnlockState = 3; // The Elder dead
|
public const int PurpleRainUnlockState = 3; // The Elder dead
|
||||||
public const KeyCode PurpleRainKey = KeyCode.G;
|
// The keybind used to live here as a KeyCode const; it is now
|
||||||
|
// TrentaConfigManagement's PurpleRainKey (a rebindable KeyboardShortcut), read directly
|
||||||
|
// by TrentaAbilities.
|
||||||
|
|
||||||
public const float PurpleRainCooldown = 20f;
|
// Forward to TrentaConfigManagement (BepInEx ConfigEntry) - see that class.
|
||||||
public const float PurpleRainRadius = 8f; // TODO: tune
|
public static float PurpleRainCooldown => TrentaConfigManagement.PurpleRainCooldown.Value;
|
||||||
public const float PurpleRainHealAmount = 40f; // TODO: tune - flat heal per ally hit
|
public static float PurpleRainRadius => TrentaConfigManagement.PurpleRainRadius.Value;
|
||||||
public const float PurpleRainPoisonDamage = 40f; // TODO: tune - a Poison-type hit; vanilla's
|
public static float PurpleRainHealAmount => TrentaConfigManagement.PurpleRainHealAmount.Value;
|
||||||
// own poison-on-hit handling takes over
|
public static float PurpleRainPoisonDamage => TrentaConfigManagement.PurpleRainPoisonDamage.Value;
|
||||||
// from there, same as SkeletonRace's fire
|
// A Poison-type hit; vanilla's own
|
||||||
// aura just deals Fire damage and lets
|
// poison-on-hit handling takes over from
|
||||||
// the burn status follow from that.
|
// there, same as SkeletonRace's fire aura
|
||||||
|
// just deals Fire damage and lets the
|
||||||
|
// burn status follow from that.
|
||||||
|
|
||||||
public const string PurpleRainCdSE = "SE_TrentaPurpleRainCooldown";
|
public const string PurpleRainCdSE = "SE_TrentaPurpleRainCooldown";
|
||||||
|
|
||||||
|
|
@ -141,12 +146,13 @@ namespace RacesOfValheim
|
||||||
// Last Stand: always-on armor bonus that scales with health already lost, so it does
|
// Last Stand: always-on armor bonus that scales with health already lost, so it does
|
||||||
// nothing at full health and its most at the edge of death. SE_TrentaStats.ModifyArmorMods
|
// nothing at full health and its most at the edge of death. SE_TrentaStats.ModifyArmorMods
|
||||||
// reads this every time armor is computed - there is no timer or trigger to it.
|
// reads this every time armor is computed - there is no timer or trigger to it.
|
||||||
public const float LastStandMaxArmorBonus = 0.5f; // +50% armor at ~0 health remaining
|
// Forwards to TrentaConfigManagement (BepInEx ConfigEntry) - see that class.
|
||||||
|
public static float LastStandMaxArmorBonus => TrentaConfigManagement.LastStandMaxArmorBonus.Value;
|
||||||
|
|
||||||
// Thorns: reflects this fraction of every hit taken back at whoever landed it.
|
// Thorns: reflects this fraction of every hit taken back at whoever landed it.
|
||||||
// Trenta_Character_Damage_Thorns_Patch reads it fresh on every hit - no timer, no charge,
|
// Trenta_Character_Damage_Thorns_Patch reads it fresh on every hit - no timer, no charge,
|
||||||
// no cooldown, it just always applies. Replaces Camouflage, which never worked reliably.
|
// no cooldown, it just always applies. Replaces Camouflage, which never worked reliably.
|
||||||
public const float ThornsReflectPercent = 0.2f;
|
public static float ThornsReflectPercent => TrentaConfigManagement.ThornsReflectPercent.Value;
|
||||||
|
|
||||||
// ─── Homecoming Portal (Yagluth) ─────────────────────────────────────
|
// ─── Homecoming Portal (Yagluth) ─────────────────────────────────────
|
||||||
// Opens a linked pair of portals - one where the Trenta is standing, one at their
|
// Opens a linked pair of portals - one where the Trenta is standing, one at their
|
||||||
|
|
@ -156,11 +162,13 @@ namespace RacesOfValheim
|
||||||
// custom (TrentaPortal.cs), not a re-skinned vanilla TeleportWorld, which is exactly why
|
// custom (TrentaPortal.cs), not a re-skinned vanilla TeleportWorld, which is exactly why
|
||||||
// it can skip the raw-ore restriction the real thing carries.
|
// it can skip the raw-ore restriction the real thing carries.
|
||||||
public const int PortalUnlockState = 6; // Yagluth dead
|
public const int PortalUnlockState = 6; // Yagluth dead
|
||||||
public const KeyCode PortalKey = KeyCode.H;
|
// The keybind used to live here as a KeyCode const; it is now TrentaConfigManagement's
|
||||||
|
// PortalKey (a rebindable KeyboardShortcut), read directly by TrentaAbilities.
|
||||||
|
|
||||||
public const float PortalCooldown = 300f; // 5 minutes
|
// Forward to TrentaConfigManagement (BepInEx ConfigEntry) - see that class.
|
||||||
public const float PortalLifetime = 30f;
|
public static float PortalCooldown => TrentaConfigManagement.PortalCooldown.Value;
|
||||||
public const float PortalSpawnDistance = 2f; // meters in front of the player, where it opens
|
public static float PortalLifetime => TrentaConfigManagement.PortalLifetime.Value;
|
||||||
|
public static float PortalSpawnDistance => TrentaConfigManagement.PortalSpawnDistance.Value;
|
||||||
|
|
||||||
// Source of the swirl visual the portal clones and retints. "portal_wood" is the
|
// Source of the swirl visual the portal clones and retints. "portal_wood" is the
|
||||||
// confirmed internal ID of the vanilla portal piece (verified against a live source
|
// confirmed internal ID of the vanilla portal piece (verified against a live source
|
||||||
|
|
@ -184,13 +192,14 @@ namespace RacesOfValheim
|
||||||
// (probably scene data on the wild instance, not code), so this one rests on the wiki's
|
// (probably scene data on the wild instance, not code), so this one rests on the wiki's
|
||||||
// account of live behaviour rather than the assembly's own IL the way most numbers in
|
// account of live behaviour rather than the assembly's own IL the way most numbers in
|
||||||
// this file do - flag it if it reads as too strong or too weak once tried.
|
// this file do - flag it if it reads as too strong or too weak once tried.
|
||||||
public const float HornetsNestDamagePerTick = 10f;
|
// Forward to TrentaConfigManagement (BepInEx ConfigEntry) - see that class.
|
||||||
public const float HornetsNestTickInterval = 4f;
|
public static float HornetsNestDamagePerTick => TrentaConfigManagement.HornetsNestDamagePerTick.Value;
|
||||||
|
public static float HornetsNestTickInterval => TrentaConfigManagement.HornetsNestTickInterval.Value;
|
||||||
|
|
||||||
public const float HornetsNestEngageRadius = 6f; // TODO: tune - how close a foe has to get
|
public static float HornetsNestEngageRadius => TrentaConfigManagement.HornetsNestEngageRadius.Value; // how close a foe has to get
|
||||||
public const float HornetsNestFollowSpeed = 8f; // TODO: tune
|
public static float HornetsNestFollowSpeed => TrentaConfigManagement.HornetsNestFollowSpeed.Value;
|
||||||
public const float HornetsNestOrbitRadius = 0.6f; // how tightly it hugs the Trenta at rest
|
public static float HornetsNestOrbitRadius => TrentaConfigManagement.HornetsNestOrbitRadius.Value; // how tightly it hugs the Trenta at rest
|
||||||
public const float HornetsNestAttackHeight = 1.5f; // hovers this high over a target it is stinging - the "from above" for the pierce half of each tick
|
public static float HornetsNestAttackHeight => TrentaConfigManagement.HornetsNestAttackHeight.Value; // hovers this high over a target it is stinging - the "from above" for the pierce half of each tick
|
||||||
|
|
||||||
// The flies only, not the smoke or the drip, off the same "Draugr" prefab
|
// The flies only, not the smoke or the drip, off the same "Draugr" prefab
|
||||||
// DraughRace.EnsureVFX already reads for its own aura - same source, same filtering rule,
|
// DraughRace.EnsureVFX already reads for its own aura - same source, same filtering rule,
|
||||||
|
|
@ -211,26 +220,28 @@ namespace RacesOfValheim
|
||||||
// pattern) about as closely as two independent races' code can - both are read, not
|
// pattern) about as closely as two independent races' code can - both are read, not
|
||||||
// guessed, so the shape of this is trustworthy even where individual numbers below are not.
|
// guessed, so the shape of this is trustworthy even where individual numbers below are not.
|
||||||
public const int MuspellUnlockState = 8; // Fader dead
|
public const int MuspellUnlockState = 8; // Fader dead
|
||||||
public const KeyCode MuspellKey = KeyCode.J;
|
// The keybind used to live here as a KeyCode const; it is now TrentaConfigManagement's
|
||||||
|
// MuspellKey (a rebindable KeyboardShortcut), read directly by TrentaAbilities.
|
||||||
|
|
||||||
// "gd_king" is The Elder's own internal prefab name, confirmed against a live source
|
// "gd_king" is The Elder's own internal prefab name, confirmed against a live source
|
||||||
// (not guessed) the same way "portal_wood" and "Draugr" were.
|
// (not guessed) the same way "portal_wood" and "Draugr" were.
|
||||||
public const string MuspellFormPrefab = "gd_king";
|
public const string MuspellFormPrefab = "gd_king";
|
||||||
public const float MuspellScale = 0.5f;
|
// Forward to TrentaConfigManagement (BepInEx ConfigEntry) - see that class.
|
||||||
|
public static float MuspellScale => TrentaConfigManagement.MuspellScale.Value;
|
||||||
|
|
||||||
// Stomp's damage/radius are still this mod's own numbers - TODO: replace with
|
// Stomp's damage/radius are still this mod's own numbers - TODO: replace with
|
||||||
// gd_king_stomp's own SharedData.m_damages once dumpelder reports it, the same way the
|
// gd_king_stomp's own SharedData.m_damages once dumpelder reports it, the same way the
|
||||||
// trigger name below was replaced with a read value instead of a guess.
|
// trigger name below was replaced with a read value instead of a guess.
|
||||||
public const float MuspellStompDamage = 60f;
|
public static float MuspellStompDamage => TrentaConfigManagement.MuspellStompDamage.Value;
|
||||||
public const float MuspellStompRadius = 2.5f; // TODO: tune
|
public static float MuspellStompRadius => TrentaConfigManagement.MuspellStompRadius.Value;
|
||||||
|
|
||||||
// The ranged attack is a real Projectile (type=Projectile, range 8-24), not an instant
|
// The ranged attack is a real Projectile (type=Projectile, range 8-24), not an instant
|
||||||
// cone hit - "gdking_root_projectile", The Elder's own vine/spike shot, spawned and set up
|
// cone hit - "gdking_root_projectile", The Elder's own vine/spike shot, spawned and set up
|
||||||
// exactly the way Attack.FireProjectileBurst does it (Instantiate, new HitData, IProjectile
|
// exactly the way Attack.FireProjectileBurst does it (Instantiate, new HitData, IProjectile
|
||||||
// .Setup), for "identico" rather than an approximation.
|
// .Setup), for "identico" rather than an approximation.
|
||||||
public const string MuspellSpikeProjectilePrefab = "gdking_root_projectile";
|
public const string MuspellSpikeProjectilePrefab = "gdking_root_projectile";
|
||||||
public const float MuspellSpikeDamage = 35f; // TODO: replace with the projectile's own m_damage once dumpelder reports it
|
public static float MuspellSpikeDamage => TrentaConfigManagement.MuspellSpikeDamage.Value; // TODO: replace with the projectile's own m_damage once dumpelder reports it
|
||||||
public const float MuspellSpikeVelocity = 20f; // TODO: tune - m_projectileVel isn't in this dump yet either
|
public static float MuspellSpikeVelocity => TrentaConfigManagement.MuspellSpikeVelocity.Value; // TODO: m_projectileVel isn't in this dump yet either
|
||||||
|
|
||||||
// Read straight off gd_king's own default weapons via the "dumpelder" console command
|
// Read straight off gd_king's own default weapons via the "dumpelder" console command
|
||||||
// (RacesOfValheim.DumpElderCommand) rather than guessed - confirmed by IL that
|
// (RacesOfValheim.DumpElderCommand) rather than guessed - confirmed by IL that
|
||||||
|
|
@ -300,8 +311,9 @@ namespace RacesOfValheim
|
||||||
"MarinatedGreens" // Marinated greens
|
"MarinatedGreens" // Marinated greens
|
||||||
};
|
};
|
||||||
|
|
||||||
// Digestion runs twice as long for a Trenta eating any of the foods above.
|
// Digestion runs longer for a Trenta eating any of the foods above. Forwards to
|
||||||
public const float FoodDurationMultiplier = 2f;
|
// TrentaConfigManagement (BepInEx ConfigEntry) - see that class.
|
||||||
|
public static float FoodDurationMultiplier => TrentaConfigManagement.FoodDurationMultiplier.Value;
|
||||||
|
|
||||||
// ─── Awakened seeds ──────────────────────────────────────────────────
|
// ─── Awakened seeds ──────────────────────────────────────────────────
|
||||||
// Once a Trenta has felled Eikthyr, every seed, cone, acorn and self-seeding mushroom in
|
// Once a Trenta has felled Eikthyr, every seed, cone, acorn and self-seeding mushroom in
|
||||||
|
|
|
||||||
155
JotunnModStub/Trenta/TrentaConfigManagement.cs
Normal file
155
JotunnModStub/Trenta/TrentaConfigManagement.cs
Normal file
|
|
@ -0,0 +1,155 @@
|
||||||
|
using UnityEngine;
|
||||||
|
using BepInEx.Configuration;
|
||||||
|
|
||||||
|
namespace RacesOfValheim
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The BepInEx-configurable slice of the Trenta's numbers, bound as ConfigEntry so they show
|
||||||
|
/// up in Configuration Manager without touching code - see CONFIGURATION-MANAGER-HOWTO.md.
|
||||||
|
/// Bound once, from RacesOfValheim.Awake(). One section per topic (matches every other race's
|
||||||
|
/// layout).
|
||||||
|
///
|
||||||
|
/// Named separately from the pre-existing TrentaConfig (rather than folding into it), same
|
||||||
|
/// reasoning as DvergarConfigManagement: that class is a different kind of thing - identity
|
||||||
|
/// constants that must never change once a player has the race (RaceId, status effect and
|
||||||
|
/// prefab names - renaming them would orphan saved characters or break asset lookups),
|
||||||
|
/// hand-tuned cosmetic placement numbers (skin colour, crown position), and design-time data
|
||||||
|
/// tables (HealthBonusByState, the per-biome AwakenedSeedFoods list) left alone under the same
|
||||||
|
/// boundary drawn for every other race's progression table. Only the genuine ability knobs -
|
||||||
|
/// Photosynthesis, Purple Rain, Last Stand/Thorns, Homecoming Portal, Hornet's Nest, Muspell,
|
||||||
|
/// and the vegan food duration bonus - plus the three transform/ability keybinds, belong here.
|
||||||
|
/// TrentaConfig's own fields for those now forward to this class (same const-to-property trick
|
||||||
|
/// used for Skadi and Dvergar), so every existing call site kept working unchanged except the
|
||||||
|
/// three keybind consumers in TrentaAbilities, which now read the live configured key.
|
||||||
|
///
|
||||||
|
/// Everything here is read live on every use - TrentaProgression.GetRules only caches
|
||||||
|
/// HealthBonus (from the untouched table above), so none of this needs a relog to take effect.
|
||||||
|
/// </summary>
|
||||||
|
public static class TrentaConfigManagement
|
||||||
|
{
|
||||||
|
// ─── Keybinds ──────────────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<KeyboardShortcut> PurpleRainKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> PortalKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> MuspellKey;
|
||||||
|
|
||||||
|
// ─── Photosynthesis (tier 1+, passive) ───────────────────────────────
|
||||||
|
public static ConfigEntry<float> PhotosynthesisStillnessSeconds;
|
||||||
|
public static ConfigEntry<int> PhotosynthesisHealSeconds;
|
||||||
|
public static ConfigEntry<float> PhotosynthesisHealPercentPerSecond;
|
||||||
|
public static ConfigEntry<float> PhotosynthesisRestBaseMinutes;
|
||||||
|
public static ConfigEntry<float> PhotosynthesisRestMinutesPerBoss;
|
||||||
|
|
||||||
|
// ─── Purple Rain (tier 3+) ────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> PurpleRainCooldown;
|
||||||
|
public static ConfigEntry<float> MuspellPurpleRainCooldown;
|
||||||
|
public static ConfigEntry<float> PurpleRainRadius;
|
||||||
|
public static ConfigEntry<float> PurpleRainHealAmount;
|
||||||
|
public static ConfigEntry<float> PurpleRainPoisonDamage;
|
||||||
|
|
||||||
|
// ─── Last Stand & Thorns (tier 5+) ────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> LastStandMaxArmorBonus;
|
||||||
|
public static ConfigEntry<float> ThornsReflectPercent;
|
||||||
|
|
||||||
|
// ─── Homecoming Portal (tier 6+) ──────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> PortalCooldown;
|
||||||
|
public static ConfigEntry<float> PortalLifetime;
|
||||||
|
public static ConfigEntry<float> PortalSpawnDistance;
|
||||||
|
|
||||||
|
// ─── Hornet's Nest (tier 7+, passive) ─────────────────────────────────
|
||||||
|
public static ConfigEntry<float> HornetsNestDamagePerTick;
|
||||||
|
public static ConfigEntry<float> HornetsNestTickInterval;
|
||||||
|
public static ConfigEntry<float> HornetsNestEngageRadius;
|
||||||
|
public static ConfigEntry<float> HornetsNestFollowSpeed;
|
||||||
|
public static ConfigEntry<float> HornetsNestOrbitRadius;
|
||||||
|
public static ConfigEntry<float> HornetsNestAttackHeight;
|
||||||
|
|
||||||
|
// ─── Muspell (tier 8) ──────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> MuspellScale;
|
||||||
|
public static ConfigEntry<float> MuspellStompDamage;
|
||||||
|
public static ConfigEntry<float> MuspellStompRadius;
|
||||||
|
public static ConfigEntry<float> MuspellSpikeDamage;
|
||||||
|
public static ConfigEntry<float> MuspellSpikeVelocity;
|
||||||
|
|
||||||
|
// ─── Diet ──────────────────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> FoodDurationMultiplier;
|
||||||
|
|
||||||
|
public static void Bind(ConfigFile config)
|
||||||
|
{
|
||||||
|
const string keybinds = "Trenta - Keybinds";
|
||||||
|
PurpleRainKey = config.Bind(keybinds, "Purple Rain", new KeyboardShortcut(KeyCode.G),
|
||||||
|
new ConfigDescription("Casts Purple Rain, tier 3+."));
|
||||||
|
PortalKey = config.Bind(keybinds, "Homecoming Portal", new KeyboardShortcut(KeyCode.H),
|
||||||
|
new ConfigDescription("Opens the Homecoming Portal pair, tier 6+."));
|
||||||
|
MuspellKey = config.Bind(keybinds, "Muspell Form", new KeyboardShortcut(KeyCode.J),
|
||||||
|
new ConfigDescription("Transform into (or revert from) Muspell, tier 8."));
|
||||||
|
|
||||||
|
const string photo = "Trenta - Photosynthesis";
|
||||||
|
PhotosynthesisStillnessSeconds = config.Bind(photo, "Stillness Seconds", 10f,
|
||||||
|
new ConfigDescription("Seconds standing still in daylight, out from under a roof, before healing begins.", new AcceptableValueRange<float>(1f, 60f)));
|
||||||
|
PhotosynthesisHealSeconds = config.Bind(photo, "Heal Ticks", 8,
|
||||||
|
new ConfigDescription("Number of 1-second heal ticks once it fires.", new AcceptableValueRange<int>(1, 30)));
|
||||||
|
PhotosynthesisHealPercentPerSecond = config.Bind(photo, "Heal Percent Per Tick", 0.10f,
|
||||||
|
new ConfigDescription("Fraction of max health healed per tick.", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
PhotosynthesisRestBaseMinutes = config.Bind(photo, "Rest Base Minutes", 5f,
|
||||||
|
new ConfigDescription("Rested-buff duration granted at base tier.", new AcceptableValueRange<float>(0f, 60f)));
|
||||||
|
PhotosynthesisRestMinutesPerBoss = config.Bind(photo, "Rest Minutes Per Boss", 1f,
|
||||||
|
new ConfigDescription("Extra Rested-buff minutes, per boss defeated.", new AcceptableValueRange<float>(0f, 10f)));
|
||||||
|
|
||||||
|
const string purpleRain = "Trenta - Purple Rain";
|
||||||
|
PurpleRainCooldown = config.Bind(purpleRain, "Cooldown", 20f,
|
||||||
|
new ConfigDescription("Seconds between casts in human form.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
MuspellPurpleRainCooldown = config.Bind(purpleRain, "Muspell Cooldown", 10f,
|
||||||
|
new ConfigDescription("Seconds between casts while transformed into Muspell.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
PurpleRainRadius = config.Bind(purpleRain, "Radius", 8f,
|
||||||
|
new ConfigDescription("Meters from the player the spray reaches.", new AcceptableValueRange<float>(1f, 30f)));
|
||||||
|
PurpleRainHealAmount = config.Bind(purpleRain, "Ally Heal Amount", 40f,
|
||||||
|
new ConfigDescription("Flat heal applied to every ally hit.", new AcceptableValueRange<float>(0f, 200f)));
|
||||||
|
PurpleRainPoisonDamage = config.Bind(purpleRain, "Enemy Poison Damage", 40f,
|
||||||
|
new ConfigDescription("Flat poison damage applied to every enemy hit.", new AcceptableValueRange<float>(0f, 200f)));
|
||||||
|
|
||||||
|
const string lastStand = "Trenta - Last Stand & Thorns";
|
||||||
|
LastStandMaxArmorBonus = config.Bind(lastStand, "Last Stand Max Armor Bonus", 0.5f,
|
||||||
|
new ConfigDescription("Armor multiplier bonus at near-zero health, tier 5+ (0.5 = +50%). Scales down to 0 at full health.", new AcceptableValueRange<float>(0f, 3f)));
|
||||||
|
ThornsReflectPercent = config.Bind(lastStand, "Thorns Reflect Percent", 0.2f,
|
||||||
|
new ConfigDescription("Fraction of every hit taken reflected back at the attacker, tier 5+.", new AcceptableValueRange<float>(0f, 1f)));
|
||||||
|
|
||||||
|
const string portal = "Trenta - Homecoming Portal";
|
||||||
|
PortalCooldown = config.Bind(portal, "Cooldown", 300f,
|
||||||
|
new ConfigDescription("Seconds between casts, tier 6+.", new AcceptableValueRange<float>(0f, 3600f)));
|
||||||
|
PortalLifetime = config.Bind(portal, "Lifetime", 30f,
|
||||||
|
new ConfigDescription("Seconds the portal pair stays open.", new AcceptableValueRange<float>(5f, 300f)));
|
||||||
|
PortalSpawnDistance = config.Bind(portal, "Spawn Distance", 2f,
|
||||||
|
new ConfigDescription("Meters in front of the player the cast-side portal opens.", new AcceptableValueRange<float>(0.5f, 10f)));
|
||||||
|
|
||||||
|
const string hornets = "Trenta - Hornet’s Nest";
|
||||||
|
HornetsNestDamagePerTick = config.Bind(hornets, "Damage Per Tick", 10f,
|
||||||
|
new ConfigDescription("Poison and pierce damage dealt per sting, tier 7+.", new AcceptableValueRange<float>(0f, 50f)));
|
||||||
|
HornetsNestTickInterval = config.Bind(hornets, "Tick Interval", 4f,
|
||||||
|
new ConfigDescription("Seconds between stings on an engaged target.", new AcceptableValueRange<float>(0.5f, 20f)));
|
||||||
|
HornetsNestEngageRadius = config.Bind(hornets, "Engage Radius", 6f,
|
||||||
|
new ConfigDescription("Meters from the player within which a foe is engaged.", new AcceptableValueRange<float>(1f, 30f)));
|
||||||
|
HornetsNestFollowSpeed = config.Bind(hornets, "Follow Speed", 8f,
|
||||||
|
new ConfigDescription("Meters per second the nest moves to reach its target or resting orbit.", new AcceptableValueRange<float>(1f, 30f)));
|
||||||
|
HornetsNestOrbitRadius = config.Bind(hornets, "Orbit Radius", 0.6f,
|
||||||
|
new ConfigDescription("How tightly it hugs the player while at rest.", new AcceptableValueRange<float>(0.1f, 5f)));
|
||||||
|
HornetsNestAttackHeight = config.Bind(hornets, "Attack Height", 1.5f,
|
||||||
|
new ConfigDescription("Meters above a target it hovers while stinging.", new AcceptableValueRange<float>(0f, 5f)));
|
||||||
|
|
||||||
|
const string muspell = "Trenta - Muspell";
|
||||||
|
MuspellScale = config.Bind(muspell, "Model Scale", 0.5f,
|
||||||
|
new ConfigDescription("Model scale while transformed, tier 8.", new AcceptableValueRange<float>(0.1f, 2f)));
|
||||||
|
MuspellStompDamage = config.Bind(muspell, "Stomp Damage", 60f,
|
||||||
|
new ConfigDescription("Base damage of the stomp attack, before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
MuspellStompRadius = config.Bind(muspell, "Stomp Radius", 2.5f,
|
||||||
|
new ConfigDescription("Hit-sweep radius for the stomp.", new AcceptableValueRange<float>(1f, 10f)));
|
||||||
|
MuspellSpikeDamage = config.Bind(muspell, "Spike Damage", 35f,
|
||||||
|
new ConfigDescription("Base pierce damage of the root-spike projectile, before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 200f)));
|
||||||
|
MuspellSpikeVelocity = config.Bind(muspell, "Spike Velocity", 20f,
|
||||||
|
new ConfigDescription("Travel speed of the root-spike projectile.", new AcceptableValueRange<float>(1f, 60f)));
|
||||||
|
|
||||||
|
const string diet = "Trenta - Diet";
|
||||||
|
FoodDurationMultiplier = config.Bind(diet, "Vegan Food Duration Multiplier", 2f,
|
||||||
|
new ConfigDescription("Multiplies digestion time for every vegan-safe food eaten.", new AcceptableValueRange<float>(1f, 5f)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
133
JotunnModStub/Trol/TrolConfig.cs
Normal file
133
JotunnModStub/Trol/TrolConfig.cs
Normal file
|
|
@ -0,0 +1,133 @@
|
||||||
|
using UnityEngine;
|
||||||
|
using BepInEx.Configuration;
|
||||||
|
|
||||||
|
namespace RacesOfValheim
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Every tunable number and keybind behind the Trol's abilities, bound as BepInEx ConfigEntry
|
||||||
|
/// so they show up in Configuration Manager without touching code - see
|
||||||
|
/// CONFIGURATION-MANAGER-HOWTO.md. Bound once, from RacesOfValheim.Awake(). One section per
|
||||||
|
/// topic (matches every other race's layout).
|
||||||
|
///
|
||||||
|
/// Tier-gate thresholds (which progression state unlocks each perk) are left as-is, same
|
||||||
|
/// boundary drawn for every other race's progression table - not exposed here.
|
||||||
|
///
|
||||||
|
/// True Form's scale (Normal/Advanced) is read from both the local transform routine
|
||||||
|
/// (TrolRace) and the remote-sizing postfix (TrolPatches) - both now read the same
|
||||||
|
/// ConfigEntry rather than each carrying its own literal, so a retuned value can no longer
|
||||||
|
/// make a Trol one size to themselves and another to everyone else.
|
||||||
|
/// </summary>
|
||||||
|
public static class TrolConfig
|
||||||
|
{
|
||||||
|
// ─── Keybinds ──────────────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<KeyboardShortcut> ThrowRockKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> TrueFormKey;
|
||||||
|
public static ConfigEntry<KeyboardShortcut> GrabLogKey;
|
||||||
|
|
||||||
|
// ─── Passive combat ──────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> FireWeaknessMultiplier;
|
||||||
|
public static ConfigEntry<float> BonemassMeleeBonus;
|
||||||
|
public static ConfigEntry<float> YagluthMeleeBonus;
|
||||||
|
public static ConfigEntry<float> TrueFormMeleeBonus;
|
||||||
|
public static ConfigEntry<float> RegenMultiplierBonus;
|
||||||
|
public static ConfigEntry<float> FavoredSkillXPMultiplier;
|
||||||
|
public static ConfigEntry<float> CarryWeightBonusBase;
|
||||||
|
public static ConfigEntry<float> CarryWeightBonusBonemass;
|
||||||
|
public static ConfigEntry<float> CarryWeightBonusYagluth;
|
||||||
|
public static ConfigEntry<float> ArmorBonusPerState;
|
||||||
|
|
||||||
|
// ─── Throw Rock (tier 3+) ─────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> ThrowRockCooldown;
|
||||||
|
public static ConfigEntry<float> ThrowRockCooldownTrueForm;
|
||||||
|
public static ConfigEntry<float> ThrowRockBaseDamage;
|
||||||
|
public static ConfigEntry<float> ThrowRockBonemassBonus;
|
||||||
|
public static ConfigEntry<float> ThrowRockYagluthBonus;
|
||||||
|
public static ConfigEntry<float> ThrowRockTrueFormBonus;
|
||||||
|
public static ConfigEntry<float> ThrowRockProjectileVelocity;
|
||||||
|
public static ConfigEntry<float> ThrowLogVelocity;
|
||||||
|
|
||||||
|
// ─── True Form (tier 5+) ───────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> TrueFormDuration;
|
||||||
|
public static ConfigEntry<float> TrueFormCooldown;
|
||||||
|
public static ConfigEntry<float> TrueFormScaleNormal;
|
||||||
|
public static ConfigEntry<float> TrueFormScaleAdvanced;
|
||||||
|
|
||||||
|
// ─── Log Weapon (tier 7+) ──────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> LogWeaponMaxDurability;
|
||||||
|
public static ConfigEntry<float> LogWeaponDurabilityDrainPerHit;
|
||||||
|
|
||||||
|
// ─── Farming ───────────────────────────────────────────────────────────
|
||||||
|
public static ConfigEntry<float> UnarmedFarmingDamageBonusPerState;
|
||||||
|
|
||||||
|
public static void Bind(ConfigFile config)
|
||||||
|
{
|
||||||
|
const string keybinds = "Trol - Keybinds";
|
||||||
|
ThrowRockKey = config.Bind(keybinds, "Throw Rock", new KeyboardShortcut(KeyCode.G),
|
||||||
|
new ConfigDescription("Throws a rock (or the log you're holding), tier 3+."));
|
||||||
|
TrueFormKey = config.Bind(keybinds, "True Form", new KeyboardShortcut(KeyCode.H),
|
||||||
|
new ConfigDescription("Transform into (or revert from) True Form, tier 5+."));
|
||||||
|
GrabLogKey = config.Bind(keybinds, "Grab Log", new KeyboardShortcut(KeyCode.E),
|
||||||
|
new ConfigDescription("Grabs a felled log as a weapon while looking at one, tier 7+ and already in True Form. Matches vanilla's own interact key rather than reusing the True Form key a second time."));
|
||||||
|
|
||||||
|
const string combat = "Trol - Passive Combat";
|
||||||
|
FireWeaknessMultiplier = config.Bind(combat, "Fire Weakness Multiplier", 1.5f,
|
||||||
|
new ConfigDescription("Multiplies incoming fire damage (1.5 = 50% weaker).", new AcceptableValueRange<float>(1f, 3f)));
|
||||||
|
BonemassMeleeBonus = config.Bind(combat, "Bonemass Melee Bonus", 10f,
|
||||||
|
new ConfigDescription("Flat damage added to Clubs/Unarmed/Axes attacks, tier 4+.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
YagluthMeleeBonus = config.Bind(combat, "Yagluth Melee Bonus", 5f,
|
||||||
|
new ConfigDescription("Additional flat damage added to Clubs/Unarmed/Axes attacks, tier 6+.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
TrueFormMeleeBonus = config.Bind(combat, "True Form Melee Bonus", 40f,
|
||||||
|
new ConfigDescription("Flat damage added to Clubs/Unarmed/Axes attacks while in True Form.", new AcceptableValueRange<float>(0f, 200f)));
|
||||||
|
RegenMultiplierBonus = config.Bind(combat, "Regen Multiplier Bonus", 0.10f,
|
||||||
|
new ConfigDescription("Health regen multiplier bonus, tier 3+ (0.10 = +10%).", new AcceptableValueRange<float>(0f, 2f)));
|
||||||
|
FavoredSkillXPMultiplier = config.Bind(combat, "Favored Skill XP Multiplier", 2f,
|
||||||
|
new ConfigDescription("Multiplies XP gain for Clubs/Unarmed/Axes/Pickaxes/WoodCutting, tier 2+.", new AcceptableValueRange<float>(0.5f, 5f)));
|
||||||
|
CarryWeightBonusBase = config.Bind(combat, "Carry Weight Bonus (Base)", 200f,
|
||||||
|
new ConfigDescription("Flat carry weight added, always active.", new AcceptableValueRange<float>(0f, 1000f)));
|
||||||
|
CarryWeightBonusBonemass = config.Bind(combat, "Carry Weight Bonus (Bonemass)", 50f,
|
||||||
|
new ConfigDescription("Additional flat carry weight, tier 4+.", new AcceptableValueRange<float>(0f, 500f)));
|
||||||
|
CarryWeightBonusYagluth = config.Bind(combat, "Carry Weight Bonus (Yagluth)", 50f,
|
||||||
|
new ConfigDescription("Additional flat carry weight, tier 6+.", new AcceptableValueRange<float>(0f, 500f)));
|
||||||
|
ArmorBonusPerState = config.Bind(combat, "Armor Bonus Per State", 3f,
|
||||||
|
new ConfigDescription("Flat armor added, per progression state.", new AcceptableValueRange<float>(0f, 20f)));
|
||||||
|
|
||||||
|
const string throwRock = "Trol - Throw Rock";
|
||||||
|
ThrowRockCooldown = config.Bind(throwRock, "Cooldown", 60f,
|
||||||
|
new ConfigDescription("Seconds between throws in human form.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
ThrowRockCooldownTrueForm = config.Bind(throwRock, "Cooldown (True Form)", 15f,
|
||||||
|
new ConfigDescription("Seconds between throws while in True Form.", new AcceptableValueRange<float>(0f, 300f)));
|
||||||
|
ThrowRockBaseDamage = config.Bind(throwRock, "Base Damage", 25f,
|
||||||
|
new ConfigDescription("Base blunt damage of a thrown rock (not used when throwing a log).", new AcceptableValueRange<float>(0f, 200f)));
|
||||||
|
ThrowRockBonemassBonus = config.Bind(throwRock, "Bonemass Bonus", 10f,
|
||||||
|
new ConfigDescription("Additional damage, tier 4+.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
ThrowRockYagluthBonus = config.Bind(throwRock, "Yagluth Bonus", 5f,
|
||||||
|
new ConfigDescription("Additional damage, tier 6+.", new AcceptableValueRange<float>(0f, 100f)));
|
||||||
|
ThrowRockTrueFormBonus = config.Bind(throwRock, "True Form Bonus", 40f,
|
||||||
|
new ConfigDescription("Additional damage while in True Form.", new AcceptableValueRange<float>(0f, 200f)));
|
||||||
|
ThrowRockProjectileVelocity = config.Bind(throwRock, "Rock Velocity", 20f,
|
||||||
|
new ConfigDescription("Travel speed of a thrown rock.", new AcceptableValueRange<float>(1f, 60f)));
|
||||||
|
ThrowLogVelocity = config.Bind(throwRock, "Log Velocity", 60f,
|
||||||
|
new ConfigDescription("Travel speed of a thrown log (compensates for its weight/drag).", new AcceptableValueRange<float>(1f, 150f)));
|
||||||
|
|
||||||
|
const string trueForm = "Trol - True Form";
|
||||||
|
TrueFormDuration = config.Bind(trueForm, "Duration", 60f,
|
||||||
|
new ConfigDescription("Seconds True Form lasts before automatically reverting.", new AcceptableValueRange<float>(5f, 600f)));
|
||||||
|
TrueFormCooldown = config.Bind(trueForm, "Cooldown", 600f,
|
||||||
|
new ConfigDescription("Seconds between True Form activations.", new AcceptableValueRange<float>(0f, 3600f)));
|
||||||
|
TrueFormScaleNormal = config.Bind(trueForm, "Scale", 2.0f,
|
||||||
|
new ConfigDescription("Model scale while in True Form, tier 5-6.", new AcceptableValueRange<float>(1f, 4f)));
|
||||||
|
TrueFormScaleAdvanced = config.Bind(trueForm, "Scale (Tier 7+)", 2.5f,
|
||||||
|
new ConfigDescription("Model scale while in True Form, tier 7+.", new AcceptableValueRange<float>(1f, 4f)));
|
||||||
|
|
||||||
|
const string logWeapon = "Trol - Log Weapon";
|
||||||
|
LogWeaponMaxDurability = config.Bind(logWeapon, "Max Durability", 6f,
|
||||||
|
new ConfigDescription("Hits a grabbed log weapon survives before breaking, tier 7+.", new AcceptableValueRange<float>(1f, 50f)));
|
||||||
|
LogWeaponDurabilityDrainPerHit = config.Bind(logWeapon, "Durability Drain Per Hit", 1f,
|
||||||
|
new ConfigDescription("Durability spent per hit landed.", new AcceptableValueRange<float>(0.1f, 10f)));
|
||||||
|
|
||||||
|
const string farming = "Trol - Farming";
|
||||||
|
UnarmedFarmingDamageBonusPerState = config.Bind(farming, "Unarmed Damage Bonus Per State", 3f,
|
||||||
|
new ConfigDescription("Extra chop/pickaxe damage when farming or mining unarmed, per progression state.", new AcceptableValueRange<float>(0f, 20f)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -10,10 +10,10 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
if (__instance == Player.m_localPlayer && TrolRace.IsTrol())
|
if (__instance == Player.m_localPlayer && TrolRace.IsTrol())
|
||||||
{
|
{
|
||||||
// Trols are weak to fire (take 50% more damage)
|
// Trols are weak to fire
|
||||||
if (hit.m_damage.m_fire > 0f)
|
if (hit.m_damage.m_fire > 0f)
|
||||||
{
|
{
|
||||||
hit.m_damage.m_fire *= 1.5f;
|
hit.m_damage.m_fire *= TrolConfig.FireWeaknessMultiplier.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -21,37 +21,40 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
if (BossProgressionManager.GetCurrentProgressionState() >= 4) // Bonemass
|
if (BossProgressionManager.GetCurrentProgressionState() >= 4) // Bonemass
|
||||||
{
|
{
|
||||||
|
float bonus = TrolConfig.BonemassMeleeBonus.Value;
|
||||||
if (hit.m_skill == Skills.SkillType.Clubs || hit.m_skill == Skills.SkillType.Unarmed)
|
if (hit.m_skill == Skills.SkillType.Clubs || hit.m_skill == Skills.SkillType.Unarmed)
|
||||||
{
|
{
|
||||||
hit.m_damage.m_blunt += 10f;
|
hit.m_damage.m_blunt += bonus;
|
||||||
}
|
}
|
||||||
else if (hit.m_skill == Skills.SkillType.Axes)
|
else if (hit.m_skill == Skills.SkillType.Axes)
|
||||||
{
|
{
|
||||||
hit.m_damage.m_slash += 10f;
|
hit.m_damage.m_slash += bonus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BossProgressionManager.GetCurrentProgressionState() >= 6) // Yagluth
|
if (BossProgressionManager.GetCurrentProgressionState() >= 6) // Yagluth
|
||||||
{
|
{
|
||||||
|
float bonus = TrolConfig.YagluthMeleeBonus.Value;
|
||||||
if (hit.m_skill == Skills.SkillType.Clubs || hit.m_skill == Skills.SkillType.Unarmed)
|
if (hit.m_skill == Skills.SkillType.Clubs || hit.m_skill == Skills.SkillType.Unarmed)
|
||||||
{
|
{
|
||||||
hit.m_damage.m_blunt += 5f;
|
hit.m_damage.m_blunt += bonus;
|
||||||
}
|
}
|
||||||
else if (hit.m_skill == Skills.SkillType.Axes)
|
else if (hit.m_skill == Skills.SkillType.Axes)
|
||||||
{
|
{
|
||||||
hit.m_damage.m_slash += 5f;
|
hit.m_damage.m_slash += bonus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_TrolTrueForm".GetStableHashCode()))
|
if (Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_TrolTrueForm".GetStableHashCode()))
|
||||||
{
|
{
|
||||||
|
float bonus = TrolConfig.TrueFormMeleeBonus.Value;
|
||||||
if (hit.m_skill == Skills.SkillType.Clubs || hit.m_skill == Skills.SkillType.Unarmed)
|
if (hit.m_skill == Skills.SkillType.Clubs || hit.m_skill == Skills.SkillType.Unarmed)
|
||||||
{
|
{
|
||||||
hit.m_damage.m_blunt += 40f;
|
hit.m_damage.m_blunt += bonus;
|
||||||
}
|
}
|
||||||
else if (hit.m_skill == Skills.SkillType.Axes)
|
else if (hit.m_skill == Skills.SkillType.Axes)
|
||||||
{
|
{
|
||||||
hit.m_damage.m_slash += 40f;
|
hit.m_damage.m_slash += bonus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace RacesOfValheim
|
||||||
else if (state >= 3) hit.m_toolTier = 1; // Elder (Bronze)
|
else if (state >= 3) hit.m_toolTier = 1; // Elder (Bronze)
|
||||||
else if (state >= 2) hit.m_toolTier = 1; // Eikthyr (Flint/Antler)
|
else if (state >= 2) hit.m_toolTier = 1; // Eikthyr (Flint/Antler)
|
||||||
|
|
||||||
float damageBonus = state * 3f;
|
float damageBonus = state * TrolConfig.UnarmedFarmingDamageBonusPerState.Value;
|
||||||
|
|
||||||
// Convert blunt damage to chop or pickaxe damage, plus progression bonus
|
// Convert blunt damage to chop or pickaxe damage, plus progression bonus
|
||||||
if (isTree)
|
if (isTree)
|
||||||
|
|
|
||||||
|
|
@ -94,4 +94,35 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A fallen log already shows a hover prompt in vanilla - its own name, via a HoverText
|
||||||
|
/// component vanilla itself attaches (confirmed live: GetComponentInParent<Hoverable>()
|
||||||
|
/// on a log resolves to HoverText, not TreeLog itself, which only implements IDestructible).
|
||||||
|
/// A first attempt added a second, competing Hoverable component to the same GameObject and
|
||||||
|
/// it was never reached - Unity's GetComponentInParent<T>() returns only the first
|
||||||
|
/// match, and vanilla's own HoverText was already there first. The fix is to append to
|
||||||
|
/// HoverText's own result instead of trying to out-compete it.
|
||||||
|
/// </summary>
|
||||||
|
[HarmonyPatch(typeof(HoverText), "GetHoverText")]
|
||||||
|
public static class Trol_LogHoverText_Patch
|
||||||
|
{
|
||||||
|
public static void Postfix(HoverText __instance, ref string __result)
|
||||||
|
{
|
||||||
|
if (Player.m_localPlayer == null || !TrolRace.IsTrol()) return;
|
||||||
|
if (BossProgressionManager.GetCurrentProgressionState() < 7) return;
|
||||||
|
if (!Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_TrolTrueForm".GetStableHashCode())) return;
|
||||||
|
|
||||||
|
TreeLog log = ((Component)__instance).GetComponentInParent<TreeLog>();
|
||||||
|
if (log == null) return;
|
||||||
|
|
||||||
|
// Already holding a log - grabbing again is a no-op in TrolLogWeapon.GrabLog, so no
|
||||||
|
// prompt either.
|
||||||
|
ItemDrop.ItemData rightItem = HarmonyLib.Traverse.Create(Player.m_localPlayer).Field<ItemDrop.ItemData>("m_rightItem").Value;
|
||||||
|
if (rightItem != null && rightItem.m_dropPrefab != null && rightItem.m_dropPrefab.name.StartsWith("TrolWeapon_")) return;
|
||||||
|
|
||||||
|
string key = TrolConfig.GrabLogKey.Value.MainKey.ToString();
|
||||||
|
__result += $"\n[<color=yellow><b>{key}</b></color>] Grab Log";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ namespace RacesOfValheim
|
||||||
float targetScale = ScaleForState(state);
|
float targetScale = ScaleForState(state);
|
||||||
if (isTrueFormActive)
|
if (isTrueFormActive)
|
||||||
{
|
{
|
||||||
targetScale = state >= 7 ? 2.5f : 2.0f;
|
targetScale = state >= 7 ? TrolConfig.TrueFormScaleAdvanced.Value : TrolConfig.TrueFormScaleNormal.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isLocal)
|
if (!isLocal)
|
||||||
|
|
@ -204,18 +204,18 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
string race = "Human"; ZNetView nview = __instance.GetComponent<ZNetView>(); if (nview != null && nview.IsValid()) race = nview.GetZDO().GetString("RacesOfValheim_Race", "Human"); else if (__instance.m_customData != null && __instance.m_customData.TryGetValue("Race", out string savedRace)) race = savedRace; if (race == "Trol")
|
string race = "Human"; ZNetView nview = __instance.GetComponent<ZNetView>(); if (nview != null && nview.IsValid()) race = nview.GetZDO().GetString("RacesOfValheim_Race", "Human"); else if (__instance.m_customData != null && __instance.m_customData.TryGetValue("Race", out string savedRace)) race = savedRace; if (race == "Trol")
|
||||||
{
|
{
|
||||||
// Base carry weight is 300. We add 200 to make it 500.
|
// Base carry weight is 300. We add a bonus to make it 500 by default.
|
||||||
// If they wear Megingjord, it will become 500 + 150 = 650.
|
// If they wear Megingjord, it will become 500 + 150 = 650.
|
||||||
__result += 200f;
|
__result += TrolConfig.CarryWeightBonusBase.Value;
|
||||||
|
|
||||||
int state = BossProgressionManager.GetCurrentProgressionState();
|
int state = BossProgressionManager.GetCurrentProgressionState();
|
||||||
if (state >= 4)
|
if (state >= 4)
|
||||||
{
|
{
|
||||||
__result += 50f; // After Bonemass
|
__result += TrolConfig.CarryWeightBonusBonemass.Value;
|
||||||
}
|
}
|
||||||
if (state >= 6)
|
if (state >= 6)
|
||||||
{
|
{
|
||||||
__result += 50f; // After Yagluth
|
__result += TrolConfig.CarryWeightBonusYagluth.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -228,9 +228,8 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
if (__instance == Player.m_localPlayer && TrolRace.IsTrol())
|
if (__instance == Player.m_localPlayer && TrolRace.IsTrol())
|
||||||
{
|
{
|
||||||
// +3 Armor per progression state (boss defeated)
|
|
||||||
int state = BossProgressionManager.GetCurrentProgressionState();
|
int state = BossProgressionManager.GetCurrentProgressionState();
|
||||||
__result += 3f * state;
|
__result += TrolConfig.ArmorBonusPerState.Value * state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,9 +102,9 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemDrop itemDrop = customWep.ItemPrefab.GetComponent<ItemDrop>();
|
ItemDrop itemDrop = customWep.ItemPrefab.GetComponent<ItemDrop>();
|
||||||
itemDrop.m_itemData.m_shared.m_maxDurability = 6f;
|
itemDrop.m_itemData.m_shared.m_maxDurability = TrolConfig.LogWeaponMaxDurability.Value;
|
||||||
itemDrop.m_itemData.m_shared.m_useDurability = true;
|
itemDrop.m_itemData.m_shared.m_useDurability = true;
|
||||||
itemDrop.m_itemData.m_shared.m_useDurabilityDrain = 1f;
|
itemDrop.m_itemData.m_shared.m_useDurabilityDrain = TrolConfig.LogWeaponDurabilityDrainPerHit.Value;
|
||||||
itemDrop.m_itemData.m_shared.m_destroyBroken = false;
|
itemDrop.m_itemData.m_shared.m_destroyBroken = false;
|
||||||
itemDrop.m_itemData.m_shared.m_weight = 0f;
|
itemDrop.m_itemData.m_shared.m_weight = 0f;
|
||||||
itemDrop.m_itemData.m_shared.m_equipDuration = 0.1f;
|
itemDrop.m_itemData.m_shared.m_equipDuration = 0.1f;
|
||||||
|
|
@ -125,15 +125,20 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
if (RaceInput.Allowed)
|
if (RaceInput.Allowed)
|
||||||
{
|
{
|
||||||
if (Input.GetKeyDown(KeyCode.G))
|
if (TrolConfig.ThrowRockKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
TryThrowRock();
|
TryThrowRock();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.H))
|
if (TrolConfig.TrueFormKey.Value.IsDown())
|
||||||
{
|
{
|
||||||
TryTrueForm();
|
TryTrueForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (TrolConfig.GrabLogKey.Value.IsDown())
|
||||||
|
{
|
||||||
|
TryGrabLog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check log durability
|
// Check log durability
|
||||||
|
|
@ -180,18 +185,9 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
if (Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_TrolTrueForm".GetStableHashCode()))
|
if (Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_TrolTrueForm".GetStableHashCode()))
|
||||||
{
|
{
|
||||||
if (BossProgressionManager.GetCurrentProgressionState() >= 7)
|
// Grabbing a log now has its own key (TrolConfig.GrabLogKey, see TryGrabLog) -
|
||||||
{
|
// pressing True Form again while already transformed no longer tries to grab
|
||||||
GameObject hoverObj = Player.m_localPlayer.GetHoverObject();
|
// whatever you happen to be looking at.
|
||||||
if (hoverObj != null)
|
|
||||||
{
|
|
||||||
TreeLog log = hoverObj.GetComponentInParent<TreeLog>();
|
|
||||||
if (log != null)
|
|
||||||
{
|
|
||||||
TrolLogWeapon.GrabLog(Player.m_localPlayer, log);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -209,6 +205,21 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void TryGrabLog()
|
||||||
|
{
|
||||||
|
if (BossProgressionManager.GetCurrentProgressionState() < 7) return;
|
||||||
|
if (!Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_TrolTrueForm".GetStableHashCode())) return;
|
||||||
|
|
||||||
|
GameObject hoverObj = Player.m_localPlayer.GetHoverObject();
|
||||||
|
if (hoverObj == null) return;
|
||||||
|
|
||||||
|
TreeLog log = hoverObj.GetComponentInParent<TreeLog>();
|
||||||
|
if (log != null)
|
||||||
|
{
|
||||||
|
TrolLogWeapon.GrabLog(Player.m_localPlayer, log);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private System.Collections.IEnumerator TransformToTrueFormRoutine()
|
private System.Collections.IEnumerator TransformToTrueFormRoutine()
|
||||||
{
|
{
|
||||||
isTransforming = true;
|
isTransforming = true;
|
||||||
|
|
@ -221,7 +232,9 @@ namespace RacesOfValheim
|
||||||
if (visual != null)
|
if (visual != null)
|
||||||
{
|
{
|
||||||
Vector3 startScale = visual.transform.localScale;
|
Vector3 startScale = visual.transform.localScale;
|
||||||
float trueFormScale = BossProgressionManager.GetCurrentProgressionState() >= 7 ? 2.5f : 2.0f;
|
float trueFormScale = BossProgressionManager.GetCurrentProgressionState() >= 7
|
||||||
|
? TrolConfig.TrueFormScaleAdvanced.Value
|
||||||
|
: TrolConfig.TrueFormScaleNormal.Value;
|
||||||
Vector3 targetScale = new Vector3(trueFormScale, trueFormScale, trueFormScale);
|
Vector3 targetScale = new Vector3(trueFormScale, trueFormScale, trueFormScale);
|
||||||
|
|
||||||
while (elapsed < duration)
|
while (elapsed < duration)
|
||||||
|
|
@ -281,7 +294,7 @@ namespace RacesOfValheim
|
||||||
private System.Collections.IEnumerator ThrowRockRoutine()
|
private System.Collections.IEnumerator ThrowRockRoutine()
|
||||||
{
|
{
|
||||||
bool isTrueForm = Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_TrolTrueForm".GetStableHashCode());
|
bool isTrueForm = Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_TrolTrueForm".GetStableHashCode());
|
||||||
float throwRockCooldown = isTrueForm ? 15f : 60f;
|
float throwRockCooldown = isTrueForm ? TrolConfig.ThrowRockCooldownTrueForm.Value : TrolConfig.ThrowRockCooldown.Value;
|
||||||
|
|
||||||
var addedSE = Player.m_localPlayer.GetSEMan().AddStatusEffect("SE_TrolThrowRockCooldown".GetStableHashCode(), true);
|
var addedSE = Player.m_localPlayer.GetSEMan().AddStatusEffect("SE_TrolThrowRockCooldown".GetStableHashCode(), true);
|
||||||
if (addedSE != null)
|
if (addedSE != null)
|
||||||
|
|
@ -327,8 +340,8 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
if (rb != null)
|
if (rb != null)
|
||||||
{
|
{
|
||||||
// 3x speed to compensate for log weight/drag
|
// Compensates for log weight/drag
|
||||||
rb.velocity = Player.m_localPlayer.GetLookDir() * 60f;
|
rb.velocity = Player.m_localPlayer.GetLookDir() * TrolConfig.ThrowLogVelocity.Value;
|
||||||
// Add some slight rotation tumbling
|
// Add some slight rotation tumbling
|
||||||
rb.angularVelocity = new Vector3(10f, 5f, 0f);
|
rb.angularVelocity = new Vector3(10f, 5f, 0f);
|
||||||
}
|
}
|
||||||
|
|
@ -347,24 +360,24 @@ namespace RacesOfValheim
|
||||||
if (proj != null)
|
if (proj != null)
|
||||||
{
|
{
|
||||||
HitData hitData = new HitData();
|
HitData hitData = new HitData();
|
||||||
hitData.m_damage.m_blunt = 25f; // Base troll rock
|
hitData.m_damage.m_blunt = TrolConfig.ThrowRockBaseDamage.Value;
|
||||||
|
|
||||||
if (BossProgressionManager.GetCurrentProgressionState() >= 4)
|
if (BossProgressionManager.GetCurrentProgressionState() >= 4)
|
||||||
{
|
{
|
||||||
hitData.m_damage.m_blunt += 10f; // Bonemass bonus
|
hitData.m_damage.m_blunt += TrolConfig.ThrowRockBonemassBonus.Value;
|
||||||
}
|
}
|
||||||
if (BossProgressionManager.GetCurrentProgressionState() >= 6)
|
if (BossProgressionManager.GetCurrentProgressionState() >= 6)
|
||||||
{
|
{
|
||||||
hitData.m_damage.m_blunt += 5f; // Yagluth bonus
|
hitData.m_damage.m_blunt += TrolConfig.ThrowRockYagluthBonus.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isTrueForm)
|
if (isTrueForm)
|
||||||
{
|
{
|
||||||
hitData.m_damage.m_blunt += 40f; // True Form bonus
|
hitData.m_damage.m_blunt += TrolConfig.ThrowRockTrueFormBonus.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
hitData.SetAttacker(Player.m_localPlayer);
|
hitData.SetAttacker(Player.m_localPlayer);
|
||||||
proj.Setup(Player.m_localPlayer, Player.m_localPlayer.GetLookDir() * 20f, -1f, hitData, null, null);
|
proj.Setup(Player.m_localPlayer, Player.m_localPlayer.GetLookDir() * TrolConfig.ThrowRockProjectileVelocity.Value, -1f, hitData, null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace RacesOfValheim
|
||||||
// After The Elder (Progression State >= 2)
|
// After The Elder (Progression State >= 2)
|
||||||
if (BossProgressionManager.GetCurrentProgressionState() >= 3)
|
if (BossProgressionManager.GetCurrentProgressionState() >= 3)
|
||||||
{
|
{
|
||||||
regenMultiplier *= 1.10f; // +10% passive health regeneration
|
regenMultiplier *= 1f + TrolConfig.RegenMultiplierBonus.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
if (isTrolSkill)
|
if (isTrolSkill)
|
||||||
{
|
{
|
||||||
factor *= 2f;
|
factor *= TrolConfig.FavoredSkillXPMultiplier.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ namespace RacesOfValheim
|
||||||
name = "SE_TrolTrueForm";
|
name = "SE_TrolTrueForm";
|
||||||
m_name = "True Form";
|
m_name = "True Form";
|
||||||
m_tooltip = "You have unleashed your inner troll!";
|
m_tooltip = "You have unleashed your inner troll!";
|
||||||
m_ttl = 60f; // 1 minute duration
|
m_ttl = TrolConfig.TrueFormDuration.Value;
|
||||||
|
|
||||||
GameObject itemPrefab = PrefabManager.Cache.GetPrefab<GameObject>("Stone");
|
GameObject itemPrefab = PrefabManager.Cache.GetPrefab<GameObject>("Stone");
|
||||||
if (itemPrefab != null)
|
if (itemPrefab != null)
|
||||||
|
|
@ -57,7 +57,7 @@ namespace RacesOfValheim
|
||||||
name = "SE_TrolTrueFormCooldown";
|
name = "SE_TrolTrueFormCooldown";
|
||||||
m_name = "True Form Cooldown";
|
m_name = "True Form Cooldown";
|
||||||
m_tooltip = "You are exhausted from your True Form.";
|
m_tooltip = "You are exhausted from your True Form.";
|
||||||
m_ttl = 600f; // 10 minutes cooldown
|
m_ttl = TrolConfig.TrueFormCooldown.Value;
|
||||||
|
|
||||||
GameObject itemPrefab = PrefabManager.Cache.GetPrefab<GameObject>("Stone");
|
GameObject itemPrefab = PrefabManager.Cache.GetPrefab<GameObject>("Stone");
|
||||||
if (itemPrefab != null)
|
if (itemPrefab != null)
|
||||||
|
|
|
||||||
|
|
@ -128,10 +128,7 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
// Hide Helmet
|
// Hide Helmet
|
||||||
var helmetObj = HarmonyLib.Traverse.Create(vis).Field<GameObject>("m_helmetItemInstance").Value;
|
var helmetObj = HarmonyLib.Traverse.Create(vis).Field<GameObject>("m_helmetItemInstance").Value;
|
||||||
if (helmetObj != null && helmetObj.transform.localScale != Vector3.zero)
|
SkeletonVisuals.SetEquipmentPieceHidden(helmetObj, true);
|
||||||
{
|
|
||||||
helmetObj.transform.localScale = Vector3.zero;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Scale Body Armor
|
// Scale Body Armor
|
||||||
string[] armorFields = { "m_chestItemInstances", "m_legItemInstances", "m_shoulderItemInstances" };
|
string[] armorFields = { "m_chestItemInstances", "m_legItemInstances", "m_shoulderItemInstances" };
|
||||||
|
|
@ -167,7 +164,7 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
// The burning skull, grown locally for whoever we are looking at. The tier is on the
|
// The burning skull, grown locally for whoever we are looking at. The tier is on the
|
||||||
// ZDO, so this client can work out for itself whether they should be alight.
|
// ZDO, so this client can work out for itself whether they should be alight.
|
||||||
m_skeletonHeadFlame.Apply(m_player, rules.ModelPrefab == SkeletonProgression.FireModel);
|
m_skeletonHeadFlame.Apply(m_player, SkeletonConfig.HeadFireVFXEnabled.Value && rules.ModelPrefab == SkeletonProgression.FireModel);
|
||||||
|
|
||||||
// Apply Scale
|
// Apply Scale
|
||||||
Vector3 targetScale = rules.ScaleMultiplier;
|
Vector3 targetScale = rules.ScaleMultiplier;
|
||||||
|
|
|
||||||
28
README.md
28
README.md
|
|
@ -4,7 +4,7 @@ A comprehensive Valheim mod that allows you to play as different unique races, e
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
This mod currently introduces 8 custom races:
|
This mod currently introduces 9 custom races:
|
||||||
|
|
||||||
### 1. Skeleton
|
### 1. Skeleton
|
||||||
- **Stamina-less Combat**: Skeletons do not consume stamina and do not use the stamina bar.
|
- **Stamina-less Combat**: Skeletons do not consume stamina and do not use the stamina bar.
|
||||||
|
|
@ -173,6 +173,20 @@ stored on your character and travels with you between servers). In personal mode
|
||||||
boss's secondary drop to the ward - Hard Antler, Crypt Key, Wishbone, Dragon Tear,
|
boss's secondary drop to the ward - Hard Antler, Crypt Key, Wishbone, Dragon Tear,
|
||||||
Yagluth's thing, the Queen's carapace, Fader's relic - to claim that boss's tier.
|
Yagluth's thing, the Queen's carapace, Fader's relic - to claim that boss's tier.
|
||||||
|
|
||||||
|
## Factions
|
||||||
|
|
||||||
|
Every race is grouped into one of three factions, alongside a handful of vanilla creatures.
|
||||||
|
None of your faction's mobs will attack you first, and several of them go a step further:
|
||||||
|
approach one and press **E** to trade. Buy price and sell price are always the same, so
|
||||||
|
nothing is a loss to sell back.
|
||||||
|
|
||||||
|
- **Black Forest** - Trenta, Trol, Furling: at peace with Greydwarves (and their Elite and
|
||||||
|
Shaman kin), Fuling, Goblin Brute, Goblin Shaman, and Troll.
|
||||||
|
- **Mountain** - Skadi, Fenrir, Dvergar: at peace with the Drake, Wolf, Ulv, Fenring (and its
|
||||||
|
Cultists), and every Dverger.
|
||||||
|
- **Swamp** - Aswid, Draugh, Skeleton: at peace with Ghosts, Skeletons, Draugr, Wraiths,
|
||||||
|
Leeches, Abominations, and Blobs.
|
||||||
|
|
||||||
## Development & Feedback
|
## Development & Feedback
|
||||||
|
|
||||||
This is a stable release of Races of Valheim, but the mod is actively in development! We plan to add more races, gameplay elements, and refine the mechanics in future updates.
|
This is a stable release of Races of Valheim, but the mod is actively in development! We plan to add more races, gameplay elements, and refine the mechanics in future updates.
|
||||||
|
|
@ -181,6 +195,18 @@ Please write to us on my Discord server: **https://discord.gg/gbBEK2VTE**
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
**v1.4.0**
|
||||||
|
- **NEW - Factions**: Every race now has peace with a slice of vanilla's hostile roster, grouped into three factions - Black Forest (Trenta, Trol, Furling: Greydwarves, Fuling, Goblin Brute/Shaman, Troll), Mountain (Skadi, Fenrir, Dvergar: Drake, Wolf, Ulv, Fenring/Cultist, Dverger), and Swamp (Aswid, Draugh, Skeleton: Ghost, Skeleton, Draugr, Wraith, Leech, Abomination, Blob). Several of those mobs also talk and trade now - approach one with your matching race and it opens a shop instead of attacking, buying and selling at the same price.
|
||||||
|
- **NEW - Configuration Manager for every race**: every ability number, cooldown and keybind across all nine races can now be retuned from BepInEx's Configuration Manager, organized into per-topic sections (Keybinds first, then Passive Combat, then the rest), or by hand-editing the .cfg file it generates.
|
||||||
|
- **Trol**: Grabbing a felled log as a True Form weapon (tier 7+) has its own keybind now (default **E**) instead of piggybacking on the True Form key a second time, and shows a proper crosshair prompt - **[E] Grab Log** - so it's no longer a hidden mechanic with no on-screen hint.
|
||||||
|
- **Dvergar**: Eyes finally glow - a cold teal-blue that shifts to a starred creature's own colours once you're strong enough to earn them.
|
||||||
|
- **Aswid**: Eyes glow an evil red, the way the compendium always described them.
|
||||||
|
- **Skeleton**: Fixed a bug where a helmet or beard could stay visible even while the race's own head-hiding was active.
|
||||||
|
- **Skeleton**: Your chosen race now shows correctly on the main-menu character preview.
|
||||||
|
- **Skeleton**: The burning skull (Moder tier+) no longer sheds a lit torch that falls to the ground - the flame's clone is stripped down to just the particles and light it actually needs.
|
||||||
|
- **Factions**: The base Goblin (in-game display name "Fuling") wasn't actually covered by Black Forest peace or trading for any race - the code used the display name "Fuling" instead of the real prefab id "Goblin". Trenta, Trol and Furling now get real peace with it, and it trades like every other Black Forest mob.
|
||||||
|
- **Aswid**: The same "Fuling" mix-up meant the Goblin family's food never got its intended values - it silently fell back to generic nutrition instead of a Goblin-scaled amount and the promised 20-minute humanoid-prey burn time. Fixed for the Goblin, the Goblin Shaman and the Goblin Brute alike.
|
||||||
|
|
||||||
**v1.3.12**
|
**v1.3.12**
|
||||||
- **Skadi**: Dragon flight reworked. The stasis that holds a form level after you stop powering now lasts 5 seconds instead of 2. Hold Shift with W to spend 15 stamina a second on a burst of speed - the only part of flight that costs anything, since the drake arrives at The Elder long before you could pay just to stay airborne, and running dry drops you back to normal speed rather than out of the sky. S beats backwards along your aim, pitch included: look down and press it to rise away from whatever you are watching, without turning to face away from it.
|
- **Skadi**: Dragon flight reworked. The stasis that holds a form level after you stop powering now lasts 5 seconds instead of 2. Hold Shift with W to spend 15 stamina a second on a burst of speed - the only part of flight that costs anything, since the drake arrives at The Elder long before you could pay just to stay airborne, and running dry drops you back to normal speed rather than out of the sky. S beats backwards along your aim, pitch included: look down and press it to rise away from whatever you are watching, without turning to face away from it.
|
||||||
- **Skadi**: Water is no longer a trap. A flying form beats its way back out of the sea instead of paddling on the surface until it finds land. Valheim hands a swimming character to its swimming code before it ever asks whether they are flying, which is why the Aswid's bat could always take off from water and Moder never could.
|
- **Skadi**: Water is no longer a trap. A flying form beats its way back out of the sea instead of paddling on the surface until it finds land. Valheim hands a swimming character to its swimming code before it ever asks whether they are flying, which is why the Aswid's bat could always take off from water and Moder never could.
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "RacesOfValheim",
|
"name": "RacesOfValheim",
|
||||||
"description": "A Valheim mod that adds nine custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Trenta, Trol) each with unique abilities, traits, and a deep boss-driven progression system.",
|
"description": "A Valheim mod that adds nine custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Trenta, Trol) each with unique abilities, traits, and a deep boss-driven progression system.",
|
||||||
"version_number": "1.3.12",
|
"version_number": "1.4.0",
|
||||||
"website_url": "",
|
"website_url": "",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"denikson-BepInExPack_Valheim-5.4.2333",
|
"denikson-BepInExPack_Valheim-5.4.2333",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue