Merge branch 'fenrir-form-roles'

This commit is contained in:
kanym 2026-11-02 17:31:18 +01:00
commit 93d5b5424e
6 changed files with 60 additions and 16 deletions

View file

@ -45,6 +45,9 @@ namespace RacesOfValheim
public static ConfigEntry<float> FullFormJumpBonus;
public static ConfigEntry<float> FullFormFallDamageReduction;
public static ConfigEntry<float> WolfFormSpeedBonus;
public static ConfigEntry<float> UlvFormSpeedBonus;
public static ConfigEntry<float> FenringDamageReduction;
public static ConfigEntry<float> CultistExtraDamageTaken;
public static ConfigEntry<float> WolfFormFallDamageReduction;
public static ConfigEntry<float> FormStaminaRegenMultiplier;
public static ConfigEntry<float> FormStaminaDrainReduction;
@ -138,14 +141,24 @@ namespace RacesOfValheim
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)));
// Each form has a job once all three are unlocked (Lexsonn's suggestion): the Ulv
// travels, the Fenring holds the line, the Cultist burns. The speed keys were renamed
// from "Full Form Speed Bonus" and "Wolf Form Speed Bonus" so a saved .cfg cannot keep
// the old order, where the Fenring outran the Ulv.
FullFormSpeedBonus = config.Bind(buffs, "Fenring And Cultist Speed Bonus", 0.5f,
new ConfigDescription("Speed multiplier bonus while in Fenring or Cultist form. 0.5 = 50% faster.", 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)));
WolfFormSpeedBonus = config.Bind(buffs, "Wolf Speed Bonus", 0.5f,
new ConfigDescription("Speed multiplier bonus while in Wolf form, the G form before Moder.", new AcceptableValueRange<float>(0f, 3f)));
UlvFormSpeedBonus = config.Bind(buffs, "Ulv Speed Bonus", 1.0f,
new ConfigDescription("Speed multiplier bonus while in Ulv form. The fastest form by default: the one to travel in.", new AcceptableValueRange<float>(0f, 3f)));
FenringDamageReduction = config.Bind(buffs, "Fenring Damage Reduction", 0.3f,
new ConfigDescription("Share of every hit the Fenring shrugs off. 0.3 = 30% less damage taken.", new AcceptableValueRange<float>(0f, 0.9f)));
CultistExtraDamageTaken = config.Bind(buffs, "Cultist Extra Damage Taken", 0.25f,
new ConfigDescription("How much harder hits land on the Cultist. 0.25 = 25% more damage taken.", new AcceptableValueRange<float>(0f, 2f)));
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,

View file

@ -76,7 +76,7 @@ namespace RacesOfValheim {
cultistCdSE.m_icon = fenringTrophyIcon;
ItemManager.Instance.AddStatusEffect(new CustomStatusEffect(cultistCdSE, fixReference: false));
formBuffSE = ScriptableObject.CreateInstance<SE_Stats>();
formBuffSE = ScriptableObject.CreateInstance<SE_FenrirFormBuff>();
formBuffSE.name = "SE_FenrirForm";
formBuffSE.m_name = "$rov_se_fenrir_form_name";
formBuffSE.m_speedModifier = FenrirConfig.FullFormSpeedBonus.Value;
@ -87,7 +87,7 @@ namespace RacesOfValheim {
formBuffSE.m_icon = fenringTrophyIcon;
ItemManager.Instance.AddStatusEffect(new CustomStatusEffect(formBuffSE, fixReference: false));
cultistFormBuffSE = ScriptableObject.CreateInstance<SE_Stats>();
cultistFormBuffSE = ScriptableObject.CreateInstance<SE_FenrirFormBuff>();
cultistFormBuffSE.name = "SE_CultistForm";
cultistFormBuffSE.m_name = "$rov_se_fenrir_cultistform_name";
cultistFormBuffSE.m_speedModifier = FenrirConfig.FullFormSpeedBonus.Value;
@ -98,7 +98,7 @@ namespace RacesOfValheim {
cultistFormBuffSE.m_icon = fenringTrophyIcon;
ItemManager.Instance.AddStatusEffect(new CustomStatusEffect(cultistFormBuffSE, fixReference: false));
wolfFormBuffSE = ScriptableObject.CreateInstance<SE_Stats>();
wolfFormBuffSE = ScriptableObject.CreateInstance<SE_FenrirFormBuff>();
wolfFormBuffSE.name = "SE_WolfForm";
wolfFormBuffSE.m_name = "$rov_se_fenrir_wolfform_name";
wolfFormBuffSE.m_speedModifier = FenrirConfig.WolfFormSpeedBonus.Value;
@ -109,6 +109,16 @@ namespace RacesOfValheim {
ItemManager.Instance.AddStatusEffect(new CustomStatusEffect(wolfFormBuffSE, fixReference: false));
}
// Set on the live copy each time a form is taken, not on the registered template: the Wolf
// and the Ulv share SE_WolfForm but not a speed, and a changed value applies at the next
// transform instead of after a relog.
private static void SetFormBuff(StatusEffect se, float speedBonus, float damageTakenFactor)
{
if (!(se is SE_FenrirFormBuff buff)) return;
buff.m_speedModifier = speedBonus;
buff.m_damageTakenFactor = damageTakenFactor;
}
private void Update()
{
if (Player.m_localPlayer == null || EnvMan.instance == null) return;
@ -550,6 +560,7 @@ namespace RacesOfValheim {
Player.m_localPlayer.GetSEMan().AddStatusEffect("SE_WolfForm".GetStableHashCode(), true);
var se = Player.m_localPlayer.GetSEMan().GetStatusEffect("SE_WolfForm".GetStableHashCode());
if (se != null) se.m_ttl = ttl;
SetFormBuff(se, FenrirConfig.UlvFormSpeedBonus.Value, 1f);
Player.m_localPlayer.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_fenrir_are_ulv"));
}
else if (prefabName == "Wolf")
@ -558,6 +569,7 @@ namespace RacesOfValheim {
Player.m_localPlayer.GetSEMan().AddStatusEffect("SE_WolfForm".GetStableHashCode(), true);
var se = Player.m_localPlayer.GetSEMan().GetStatusEffect("SE_WolfForm".GetStableHashCode());
if (se != null) se.m_ttl = ttl;
SetFormBuff(se, FenrirConfig.WolfFormSpeedBonus.Value, 1f);
Player.m_localPlayer.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_fenrir_are_wolf"));
}
else if (prefabName == "Fenring_Cultist")
@ -566,6 +578,7 @@ namespace RacesOfValheim {
Player.m_localPlayer.GetSEMan().AddStatusEffect("SE_CultistForm".GetStableHashCode(), true);
var se = Player.m_localPlayer.GetSEMan().GetStatusEffect("SE_CultistForm".GetStableHashCode());
if (se != null) se.m_ttl = ttl;
SetFormBuff(se, FenrirConfig.FullFormSpeedBonus.Value, 1f + FenrirConfig.CultistExtraDamageTaken.Value);
Player.m_localPlayer.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_fenrir_are_cultist"));
}
else
@ -574,6 +587,7 @@ namespace RacesOfValheim {
Player.m_localPlayer.GetSEMan().AddStatusEffect("SE_FenrirForm".GetStableHashCode(), true);
var se = Player.m_localPlayer.GetSEMan().GetStatusEffect("SE_FenrirForm".GetStableHashCode());
if (se != null) se.m_ttl = ttl;
SetFormBuff(se, FenrirConfig.FullFormSpeedBonus.Value, 1f - FenrirConfig.FenringDamageReduction.Value);
Player.m_localPlayer.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_fenrir_are_fenring"));
}

View file

@ -22,6 +22,23 @@ namespace RacesOfValheim
}
}
/// <summary>
/// A form's buff, plus a scale on the hits it takes: the Fenring holds the line on less, the
/// Cultist pays for its fire with more. SEMan.OnDamaged runs in Character.RPC_Damage on the
/// owner's machine, ahead of armor and the health loss, so the scale reaches every hit,
/// whoever's machine the attacker is on.
/// </summary>
public class SE_FenrirFormBuff : SE_Stats
{
public float m_damageTakenFactor = 1f;
public override void OnDamaged(HitData hit, Character attacker)
{
base.OnDamaged(hit, attacker);
if (!Mathf.Approximately(m_damageTakenFactor, 1f)) hit.ApplyModifier(m_damageTakenFactor);
}
}
public class SE_FenrirCurse : SE_Stats
{
public override void Setup(Character character)

View file

@ -86,14 +86,14 @@
"rov_compendium_dvergar_weapon_crossbow": "Crossbow",
"rov_compendium_dvergar_weapon_hammer": "Hammer",
"rov_compendium_fenrir_beast_within_physical_stats_scale": "[Base Passive] The Beast Within: Your physical stats scale with every boss you defeat: +$1 Armor, +$2 Damage, +$3% Speed, +$4% Jump, and -$5% Fall Damage.\n",
"rov_compendium_fenrir_cultist_form_j_key_night": "[Yagluth Unlock] Cultist Form ('J' Key, night only): A robed shape that claws and channels fire. Lasts 1 minute, 10-minute cooldown.\n",
"rov_compendium_fenrir_cultist_form_j_key_night": "[Yagluth Unlock] Cultist Form ('J' Key, night only): A robed shape that claws and channels fire, and pays for it: every hit on it lands 25% harder. Lasts 1 minute, 10-minute cooldown.\n",
"rov_compendium_fenrir_cultist_form_now_answers_by": "[Fader Unlock] Cultist Form now answers by day as well as night, and may be held as long as you wish.\n",
"rov_compendium_fenrir_cultist_form_s_cooldown_falls": "[The Queen Unlock] Cultist Form's cooldown falls to 5 minutes (still night only, still 1 minute).\n",
"rov_compendium_fenrir_curse_pack": "The Curse of the Pack\n",
"rov_compendium_fenrir_cursed_claws_s_wolf_s": "[Base Passive] Cursed Claws ([K], $1s): The wolf's hands, kept on in the man's shape for a limited time instead of a weapon. Bare-handed blows land at $2% of a full-grown pair's weight, all of it as slash, and they grow with every boss that falls. Draw a sword and they wait, sheathe it and they are back, until the timer runs out and they retract on their own - no slot wasted between casts. They cannot be dropped, traded or stolen while grown - and in beast form the jaws do the work instead.\n",
"rov_compendium_fenrir_fenring_form_h_key_night": "[Moder Unlock] Fenring Form ('H' Key, night only): Stand as a true Fenring - heavy claws and a leaping strike, and the strongest of the four shapes so far.\n",
"rov_compendium_fenrir_fenring_form_h_key_night": "[Moder Unlock] Fenring Form ('H' Key, night only): Stand as a true Fenring - heavy claws and a leaping strike, and the strongest of the four shapes so far. It is the one that holds the line: every hit on it lands 30% lighter.\n",
"rov_compendium_fenrir_fenring_form_now_answers_by": "[The Queen Unlock] Fenring Form now answers by day as well as night.\n",
"rov_compendium_fenrir_g_now_calls_ulv_form": "[Moder Unlock] 'G' now calls Ulv Form instead of Wolf, and answers by day as well as night.\n",
"rov_compendium_fenrir_g_now_calls_ulv_form": "[Moder Unlock] 'G' now calls Ulv Form instead of Wolf, and answers by day as well as night. The Ulv is the fastest of your shapes, the one to travel in.\n",
"rov_compendium_fenrir_senses_in_form": "In any form you sense every untamed creature within $1m, marking it with a telltale glow, as the Aswid do.\n",
"rov_compendium_fenrir_sunrise_breaks_any_night_bound": "Sunrise breaks any night-bound form early and leaves the beast too tired to change shape again for a short while after.\n",
"rov_compendium_fenrir_title": "Fenrir Secrets",

View file

@ -86,14 +86,14 @@
"rov_compendium_dvergar_weapon_crossbow": "Balestra",
"rov_compendium_dvergar_weapon_hammer": "Martello",
"rov_compendium_fenrir_beast_within_physical_stats_scale": "[Passiva base] La bestia dentro: le tue statistiche fisiche crescono con ogni boss sconfitto: +$1 armatura, +$2 danni, +$3% velocità, +$4% salto e -$5% danni da caduta.\n",
"rov_compendium_fenrir_cultist_form_j_key_night": "[Sblocco Yagluth] Forma di Cultista (tasto 'J', solo di notte): una figura incappucciata che artiglia e incanala il fuoco. Dura 1 minuto, ricarica di 10 minuti.\n",
"rov_compendium_fenrir_cultist_form_j_key_night": "[Sblocco Yagluth] Forma di Cultista (tasto 'J', solo di notte): una figura incappucciata che artiglia e incanala il fuoco, e lo paga: ogni colpo che subisce arriva più forte del 25%. Dura 1 minuto, ricarica di 10 minuti.\n",
"rov_compendium_fenrir_cultist_form_now_answers_by": "[Sblocco Fader] La forma di Cultista ora risponde di giorno come di notte, e puoi tenerla quanto vuoi.\n",
"rov_compendium_fenrir_cultist_form_s_cooldown_falls": "[Sblocco Regina] La ricarica della forma di Cultista scende a 5 minuti (sempre solo di notte, sempre 1 minuto).\n",
"rov_compendium_fenrir_curse_pack": "La maledizione del branco\n",
"rov_compendium_fenrir_cursed_claws_s_wolf_s": "[Passiva base] Artigli maledetti ([K], $1s): le mani del lupo, tenute nella forma dell'uomo per un tempo limitato al posto di un'arma. I colpi a mani nude valgono il $2% del peso di un paio adulto, tutto come danno da taglio, e crescono con ogni boss che cade. Sfodera una spada e aspettano, rinfoderala e tornano, finché il tempo non scade e si ritraggono da soli, senza sprecare uno slot tra un uso e l'altro. Mentre sono fuori non possono essere lasciati cadere, scambiati o rubati, e in forma di bestia sono le fauci a fare il lavoro.\n",
"rov_compendium_fenrir_fenring_form_h_key_night": "[Sblocco Moder] Forma di Fenring (tasto 'H', solo di notte): ergiti come un vero Fenring, con artigli pesanti e un attacco in salto, la più forte delle quattro forme finora.\n",
"rov_compendium_fenrir_fenring_form_h_key_night": "[Sblocco Moder] Forma di Fenring (tasto 'H', solo di notte): ergiti come un vero Fenring, con artigli pesanti e un attacco in salto, la più forte delle quattro forme finora. È la forma che tiene la linea: ogni colpo che subisce arriva più leggero del 30%.\n",
"rov_compendium_fenrir_fenring_form_now_answers_by": "[Sblocco Regina] La forma di Fenring ora risponde di giorno come di notte.\n",
"rov_compendium_fenrir_g_now_calls_ulv_form": "[Sblocco Moder] 'G' ora richiama la forma di Ulv invece del Lupo, e risponde di giorno come di notte.\n",
"rov_compendium_fenrir_g_now_calls_ulv_form": "[Sblocco Moder] 'G' ora richiama la forma di Ulv invece del Lupo, e risponde di giorno come di notte. L'Ulv è la più veloce delle tue forme, quella per viaggiare.\n",
"rov_compendium_fenrir_senses_in_form": "In qualsiasi forma percepisci ogni creatura non addomesticata entro $1m, e la segni con un bagliore rivelatore, come fanno gli Aswid.\n",
"rov_compendium_fenrir_sunrise_breaks_any_night_bound": "L'alba spezza in anticipo ogni forma legata alla notte, e lascia la bestia troppo stanca per cambiare di nuovo forma per un po'.\n",
"rov_compendium_fenrir_title": "Segreti dei Fenrir",

View file

@ -86,14 +86,14 @@
"rov_compendium_dvergar_weapon_crossbow": "Арбалет",
"rov_compendium_dvergar_weapon_hammer": "Молот",
"rov_compendium_fenrir_beast_within_physical_stats_scale": "[Базовое пассивное] Зверь внутри: Ваши физические характеристики растут с каждым убитым боссом: +$1 к броне, +$2 к урону, +$3% к скорости, +$4% к прыжку и -$5% к урону от падения.\n",
"rov_compendium_fenrir_cultist_form_j_key_night": "[Награда: Яглут] Облик культиста (клавиша «J», только ночью): Облик в балахоне, раздирающий врагов когтями и направляющий потоки пламени. Длится 1 минуту, перезарядка: 10 минут.\n",
"rov_compendium_fenrir_cultist_form_j_key_night": "[Награда: Яглут] Облик культиста (клавиша «J», только ночью): Облик в балахоне, раздирающий врагов когтями и направляющий потоки пламени. За это приходится платить: каждый удар по нему наносит на 25% больше урона. Длится 1 минуту, перезарядка: 10 минут.\n",
"rov_compendium_fenrir_cultist_form_now_answers_by": "[Награда: Прародитель] Облик культиста теперь подчиняется как днем, так и ночью, и его можно удерживать сколько угодно.\n",
"rov_compendium_fenrir_cultist_form_s_cooldown_falls": "[Награда: Королева] Перезарядка облика культиста снижена до 5 минут (все еще только ночью, длительность 1 минута).\n",
"rov_compendium_fenrir_curse_pack": "Проклятие Стаи\n",
"rov_compendium_fenrir_cursed_claws_s_wolf_s": "[Базовое пассивное] Проклятые когти ([K], $1 с): Волчьи лапы, сохраняющиеся в человеческом теле на ограниченное время вместо оружия. Удары голыми руками наносят $2% от урона зрелых когтей (полностью рубящий урон), и их сила растет с каждым павшим боссом. Достаньте меч — они исчезнут, вложите в ножны — вернутся, пока не истечет время. Не тратят место в инвентаре. Их нельзя выбросить, передать или украсть, пока они активны — а в зверином облике вместо них работают челюсти.\n",
"rov_compendium_fenrir_fenring_form_h_key_night": "[Награда: Матерь] Облик фенринга (клавиша «H», только ночью): Станьте истинным Фенрингом — тяжелые когти, сокрушительный удар в прыжке и мощнейшая из четырех форм на данный момент.\n",
"rov_compendium_fenrir_fenring_form_h_key_night": "[Награда: Матерь] Облик фенринга (клавиша «H», только ночью): Станьте истинным Фенрингом — тяжелые когти, сокрушительный удар в прыжке и мощнейшая из четырех форм на данный момент. Этот облик держит строй: каждый удар по нему наносит на 30% меньше урона.\n",
"rov_compendium_fenrir_fenring_form_now_answers_by": "[Награда: Королева] Облик фенринга теперь доступен как днем, так и ночью.\n",
"rov_compendium_fenrir_g_now_calls_ulv_form": "[Награда: Матерь] Клавиша «G» теперь призывает облик Ульва вместо Волка и доступна и днем, и ночью.\n",
"rov_compendium_fenrir_g_now_calls_ulv_form": "[Награда: Матерь] Клавиша «G» теперь призывает облик Ульва вместо Волка и доступна и днем, и ночью. Ульв — самый быстрый из ваших обликов, в нем удобно путешествовать.\n",
"rov_compendium_fenrir_senses_in_form": "В любой форме вы чувствуете любое неприрученное существо в радиусе $1 м, подсвечивая его характерным свечением, как Асвиды.\n",
"rov_compendium_fenrir_sunrise_breaks_any_night_bound": "Восход солнца прерывает любую ночную форму раньше срока и оставляет зверя истощенным, не позволяя перевоплощаться еще некоторое время.\n",
"rov_compendium_fenrir_title": "Тайны Фенрира",