Merge branch 'feat-skeleton-mortal-options'
This commit is contained in:
commit
19281e31ce
9 changed files with 86 additions and 13 deletions
|
|
@ -31,6 +31,8 @@ namespace RacesOfValheim
|
|||
"Aswid - Eyes",
|
||||
"Fenrir - Appearance",
|
||||
"Skeleton - Visuals",
|
||||
// Food and stamina for a Skeleton who wants them: each only gives up an advantage.
|
||||
"Skeleton - Mortal Habits",
|
||||
"Sverm - Dorsal Spines",
|
||||
"Sverm - Emberform",
|
||||
"Trol - Appearance",
|
||||
|
|
|
|||
|
|
@ -725,7 +725,18 @@ namespace RacesOfValheim
|
|||
sb.AppendLine((state <= BossProgressionManager.MinState ? ModText.Get("rov_compendium_skeleton_stand_at_first_eight_standings") : ModText.Get("rov_compendium_skeleton_stand_at_eight_standings_earned", state, BossProgressionManager.GetBossTokenForState(state))));
|
||||
|
||||
sb.AppendLine(ModText.Get("rov_compendium_skeleton_undead_diet"));
|
||||
sb.AppendLine(ModText.Get("rov_compendium_skeleton_no_hunger_moves_no_meal", (health).ToString("0")));
|
||||
bool eats = SkeletonConfig.EatsMortalFood.Value, tires = SkeletonConfig.FeelsFatigue.Value;
|
||||
if (!eats && !tires)
|
||||
{
|
||||
sb.AppendLine(ModText.Get("rov_compendium_skeleton_no_hunger_moves_no_meal", (health).ToString("0")));
|
||||
}
|
||||
else
|
||||
{
|
||||
// A player who picked one of the "Mortal Habits" reads what they actually have.
|
||||
string diet = eats ? ModText.Get("rov_compendium_skeleton_diet_mortal") : ModText.Get("rov_compendium_skeleton_diet_bones", (health).ToString("0"));
|
||||
string effort = tires ? ModText.Get("rov_compendium_skeleton_effort_mortal") : ModText.Get("rov_compendium_skeleton_effort_none");
|
||||
sb.AppendLine(diet + " " + effort + "\n");
|
||||
}
|
||||
|
||||
sb.AppendLine(ModText.Get("rov_compendium_skeleton_bones_blades"));
|
||||
sb.AppendLine(ModText.Get("rov_compendium_skeleton_blades_points_find_little_cut"));
|
||||
|
|
|
|||
|
|
@ -49,6 +49,10 @@ namespace RacesOfValheim
|
|||
public static ConfigEntry<bool> RaiseDeadIcon;
|
||||
public static ConfigEntry<bool> ShowHelmet;
|
||||
|
||||
// ─── Mortal Habits (per player) ────────────────────────────────────────
|
||||
public static ConfigEntry<bool> EatsMortalFood;
|
||||
public static ConfigEntry<bool> FeelsFatigue;
|
||||
|
||||
public static void Bind(ConfigFile config)
|
||||
{
|
||||
const string combat = "Skeleton - Passive Combat";
|
||||
|
|
@ -88,6 +92,16 @@ namespace RacesOfValheim
|
|||
RaiseDeadIcon = config.Bind(visuals, "Raise the Dead Icon", true,
|
||||
new ConfigDescription("Shows the Raise the Dead status icon while your Summon on Kill is on."));
|
||||
ShowHelmet = config.Bind(visuals, "Show Helmet", false,
|
||||
new ConfigDescription("Off: your helmet stays hidden over the skull. On: the helmet you wear shows. Helmets and hoods are moved and enlarged to fit the skull. Your own choice: other players see you the way you picked. A viking body (Body Model Enabled off) always shows its helmet.")); }
|
||||
new ConfigDescription("Off: your helmet stays hidden over the skull. On: the helmet you wear shows. Helmets and hoods are moved and enlarged to fit the skull. Your own choice: other players see you the way you picked. A viking body (Body Model Enabled off) always shows its helmet."));
|
||||
|
||||
// For groups who want the Skeleton but miss Valheim's food or stamina. Both only take
|
||||
// away an advantage (permanent best-tier food, infinite stamina), so each player picks
|
||||
// for themselves and the server does not sync them.
|
||||
const string habits = "Skeleton - Mortal Habits";
|
||||
EatsMortalFood = config.Bind(habits, "Eats Mortal Food", false,
|
||||
new ConfigDescription("Off: you never eat, and your Maximum Health comes from your standing (the bosses you have defeated). On: you eat like the living, your health and stamina come from your meals, and the standing's health bonus is gone. Your other Skeleton powers stay. Your own choice, not synced by the server."));
|
||||
FeelsFatigue = config.Bind(habits, "Feels Fatigue", false,
|
||||
new ConfigDescription("Off: you have no stamina and never tire. On: you spend stamina like the living. Without Eats Mortal Food your stamina grows with your standing, from the same meals your health is measured by. Your own choice, not synced by the server."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,16 +44,26 @@ namespace RacesOfValheim
|
|||
/// GetTotalFoodValue has exactly one caller, Player.UpdateFood, which passes the result
|
||||
/// straight to SetMaxHealth - so this is the single point where the number is decided, and
|
||||
/// it now comes from the progression table rather than from three scaled sausages.
|
||||
///
|
||||
/// A Skeleton with "Eats Mortal Food" is left to vanilla: its real meals decide both
|
||||
/// numbers, and the tier's health, which stands in for those meals, does not stack on top.
|
||||
/// One with "Feels Fatigue" who does not eat gets the stand-in meals' stamina, which the
|
||||
/// fake foods themselves never deliver.
|
||||
/// </summary>
|
||||
[HarmonyPatch(typeof(Player), "GetTotalFoodValue")]
|
||||
public static class Player_GetTotalFoodValue_SkeletonHealth_Patch
|
||||
{
|
||||
public static void Postfix(Player __instance, ref float hp)
|
||||
public static void Postfix(Player __instance, ref float hp, ref float stamina)
|
||||
{
|
||||
if (__instance != Player.m_localPlayer || !SkeletonRace.IsSkeleton()) return;
|
||||
if (SkeletonConfig.EatsMortalFood.Value) return;
|
||||
|
||||
int state = BossProgressionManager.GetCurrentProgressionState();
|
||||
hp = __instance.m_baseHP + SkeletonProgression.GetMaxHealthBonus(state);
|
||||
if (SkeletonConfig.FeelsFatigue.Value)
|
||||
{
|
||||
stamina = __instance.m_baseStamina + SkeletonRace.GetStandInStamina(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -63,7 +73,7 @@ namespace RacesOfValheim
|
|||
public static bool Prefix(Player __instance)
|
||||
{
|
||||
// The Aswid used to be on this list. It spends stamina now, see Aswid_UseStamina_Patch.
|
||||
if ((SkeletonRace.IsSkeleton() || DraughRace.IsDraugh()) && __instance == Player.m_localPlayer)
|
||||
if (((SkeletonRace.IsSkeleton() && !SkeletonConfig.FeelsFatigue.Value) || DraughRace.IsDraugh()) && __instance == Player.m_localPlayer)
|
||||
{
|
||||
// Infinite stamina: skip the original UseStamina method
|
||||
return false;
|
||||
|
|
@ -79,7 +89,7 @@ namespace RacesOfValheim
|
|||
{
|
||||
if (__instance == Player.m_localPlayer)
|
||||
{
|
||||
if (SkeletonRace.IsSkeleton() && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Consumable && (item.m_shared.m_food > 0 || item.m_shared.m_foodStamina > 0 || item.m_shared.m_foodEitr > 0))
|
||||
if (SkeletonRace.IsSkeleton() && !SkeletonConfig.EatsMortalFood.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Consumable && (item.m_shared.m_food > 0 || item.m_shared.m_foodStamina > 0 || item.m_shared.m_foodEitr > 0))
|
||||
{
|
||||
__instance.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_skeleton_skeletons_do_not_need_eat"));
|
||||
__result = false;
|
||||
|
|
@ -194,7 +204,7 @@ namespace RacesOfValheim
|
|||
{
|
||||
try
|
||||
{
|
||||
if (player == Player.m_localPlayer && SkeletonRace.IsSkeleton())
|
||||
if (player == Player.m_localPlayer && SkeletonRace.IsSkeleton() && !SkeletonConfig.EatsMortalFood.Value)
|
||||
{
|
||||
if (__instance.m_foodBarRoot != null && __instance.m_foodBarRoot.gameObject.activeSelf)
|
||||
{
|
||||
|
|
@ -233,7 +243,7 @@ namespace RacesOfValheim
|
|||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
if (player == Player.m_localPlayer && SkeletonRace.IsSkeleton()) return false;
|
||||
if (player == Player.m_localPlayer && SkeletonRace.IsSkeleton() && !SkeletonConfig.EatsMortalFood.Value) return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,6 +125,22 @@ namespace RacesOfValheim
|
|||
Player.m_localPlayer.m_customData["Race"] == "Skeleton";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stamina from the tier's stand-in meals, for a Skeleton who feels fatigue but does not
|
||||
/// eat. The fake foods cannot supply it: they are kept at m_time 0, so UpdateFood scales
|
||||
/// their stamina to nothing on every tick.
|
||||
/// </summary>
|
||||
public static float GetStandInStamina(int state)
|
||||
{
|
||||
var foods = GetBestRealFoods(state);
|
||||
float stamina = 0f;
|
||||
if (foods != null)
|
||||
{
|
||||
foreach (var f in foods) stamina += f.m_shared.m_foodStamina;
|
||||
}
|
||||
return stamina;
|
||||
}
|
||||
|
||||
private static readonly int StatsEffectHash = "SE_SkeletonStats".GetStableHashCode();
|
||||
|
||||
private float lastAuraTime = 0f;
|
||||
|
|
@ -137,7 +153,7 @@ namespace RacesOfValheim
|
|||
|
||||
private static List<ItemDrop.ItemData>[] cachedRealFoods = new List<ItemDrop.ItemData>[9];
|
||||
|
||||
private List<ItemDrop.ItemData> GetBestRealFoods(int state)
|
||||
private static List<ItemDrop.ItemData> GetBestRealFoods(int state)
|
||||
{
|
||||
if (state < 1) state = 1;
|
||||
if (state > 8) state = 8;
|
||||
|
|
@ -453,8 +469,15 @@ namespace RacesOfValheim
|
|||
// Manage Fake Foods
|
||||
var foods = Player.m_localPlayer.GetFoods();
|
||||
bool needsFood = false;
|
||||
|
||||
if (foods.Count != 3)
|
||||
|
||||
if (SkeletonConfig.EatsMortalFood.Value)
|
||||
{
|
||||
// Real meals instead. The stand-in foods are the ones held at m_time 0 or below;
|
||||
// dropped here at once rather than left for UpdateFood, which would announce each
|
||||
// one as "food done".
|
||||
foods.RemoveAll(f => f.m_time <= 0f);
|
||||
}
|
||||
else if (foods.Count != 3)
|
||||
{
|
||||
needsFood = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -240,5 +240,9 @@
|
|||
"rov_compendium_warvulture_goes_where_look_goes_as": "It goes where you look, and it goes as long as you care to stay up: $1 meters a second costs it nothing at all. Hold your run key and it gives you $2 for $3 seconds and not a moment longer - there is only so much haste in a bird. Let go and the wind comes back into it in $4 seconds, in the air. You never have to land for it.\n",
|
||||
"rov_compendium_warvulture_vulture_s_head_kept_stick": "A vulture's head kept on a stick, and the bird answers to it. Raise it and the vulture comes back under you. Raise it again and it carries you down, deaf to you until the ground arrives - and a third time lets go of it where you are.\n",
|
||||
"rov_compendium_warvulture_war_vulture": "\n-- THE WAR VULTURE --\n",
|
||||
"rov_compendium_warvulture_what_bird_has_left_bar": "What the bird has left is the bar under your own.\n"
|
||||
"rov_compendium_warvulture_what_bird_has_left_bar": "What the bird has left is the bar under your own.\n",
|
||||
"rov_compendium_skeleton_diet_bones": "No hunger moves you and no meal can help you - mortal food is nothing to dry bones. In its place the dead grow strong as their betters fall: you carry +$1 Maximum Health at your present standing.",
|
||||
"rov_compendium_skeleton_diet_mortal": "You kept the habits of the flesh: you eat as the living do, and your health comes from your meals, not from your standing.",
|
||||
"rov_compendium_skeleton_effort_none": "Nor does effort tire you; you have no stamina to spend at all.",
|
||||
"rov_compendium_skeleton_effort_mortal": "Effort tires you as it tires the living, and you spend stamina like anyone else."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -240,5 +240,9 @@
|
|||
"rov_compendium_warvulture_goes_where_look_goes_as": "Va dove guardi, e va finché vuoi restare in aria: $1 metri al secondo non gli costano niente. Tieni premuto il tasto di corsa e ti dà $2 per $3 secondi, non un momento di più: in un uccello c'è solo tanta fretta. Lascia andare e il vento gli torna dentro in $4 secondi, in aria. Non devi mai atterrare per questo.\n",
|
||||
"rov_compendium_warvulture_vulture_s_head_kept_stick": "La testa di un avvoltoio infilata su un bastone, e l'uccello le risponde. Sollevala e l'avvoltoio torna sotto di te. Sollevala di nuovo e ti porta giù, sordo a te finché non arriva il terreno; una terza volta ti lascia andare dove sei.\n",
|
||||
"rov_compendium_warvulture_war_vulture": "\n-- L'AVVOLTOIO DA GUERRA --\n",
|
||||
"rov_compendium_warvulture_what_bird_has_left_bar": "Ciò che resta all'uccello è la barra sotto la tua.\n"
|
||||
"rov_compendium_warvulture_what_bird_has_left_bar": "Ciò che resta all'uccello è la barra sotto la tua.\n",
|
||||
"rov_compendium_skeleton_diet_bones": "Nessuna fame ti muove e nessun pasto può aiutarti: il cibo dei mortali non è niente per ossa secche. Al suo posto i morti si rafforzano man mano che i loro superiori cadono: al tuo grado attuale hai +$1 di salute massima.",
|
||||
"rov_compendium_skeleton_diet_mortal": "Hai conservato le abitudini della carne: mangi come i vivi, e la tua salute viene dai pasti, non dal tuo grado.",
|
||||
"rov_compendium_skeleton_effort_none": "Nemmeno la fatica ti stanca: non hai stamina da spendere.",
|
||||
"rov_compendium_skeleton_effort_mortal": "La fatica ti stanca come stanca i vivi, e spendi stamina come chiunque altro."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -240,5 +240,9 @@
|
|||
"rov_compendium_warvulture_goes_where_look_goes_as": "Она летит туда, куда обращен ваш взор, и летит так долго, как вы того пожелаете: полет со скоростью $1 м/с не стоит птице никаких сил. Зажмите клавишу бега — и она выдаст рывок со скоростью $2 м/с на $3 с, не дольше: птичьи силы не безграничны. Отпустите бег, и дыхание вернется к ней через $4 с прямо в воздухе. Садиться на землю не придется.\n",
|
||||
"rov_compendium_warvulture_vulture_s_head_kept_stick": "Голова стервятника на шесте, и хищная птица повинуется ей. Поднимите ее — и птица опустится вам под ноги. Поднимите снова — и она понесет вас к земле, не слушая команд до самого приземления, а поднятая в третий раз — отпустит вас на лету.\n",
|
||||
"rov_compendium_warvulture_war_vulture": "\n-- БОЕВОЙ СТЕРВЯТНИК --\n",
|
||||
"rov_compendium_warvulture_what_bird_has_left_bar": "Остаток выносливости птицы отображается шкалой под вашей собственной.\n"
|
||||
"rov_compendium_warvulture_what_bird_has_left_bar": "Остаток выносливости птицы отображается шкалой под вашей собственной.\n",
|
||||
"rov_compendium_skeleton_diet_bones": "Голод не движет вами, и никакая еда вам не поможет: смертная пища ничто для сухих костей. Взамен мёртвые крепнут по мере падения своих владык: на вашей нынешней ступени у вас +$1 к максимальному здоровью.",
|
||||
"rov_compendium_skeleton_diet_mortal": "Вы сохранили привычки плоти: вы едите, как живые, и ваше здоровье даёт пища, а не ступень.",
|
||||
"rov_compendium_skeleton_effort_none": "И усилия вас не утомляют: выносливости у вас нет вовсе.",
|
||||
"rov_compendium_skeleton_effort_mortal": "Усилия утомляют вас, как живых, и вы тратите выносливость, как все."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ Support the mod: [Patreon — NandorTheModder](https://www.patreon.com/c/NandorT
|
|||

|
||||
- **Stamina-less Combat:** Skeletons use no stamina and do not have a stamina bar.
|
||||
- **Undead Diet:** Cannot eat normal food. Max health increases automatically as you defeat bosses to make up for lack of food buffs.
|
||||
- **Mortal Habits (optional):** each player can turn on *Eats Mortal Food* (eat like the living; health comes from meals, and the boss health bonus is dropped) and *Feels Fatigue* (spend stamina like the living) in the config section `Skeleton - Mortal Habits`. Both are off by default and not synced by the server.
|
||||
- **Lit Sockets:** Your skull carries the eye lights of the creature your tier is built from, in that creature's own colour — so they change as the body does.
|
||||
- **Body Model switch:** with a player model mod (EnhancedValheimVRM and the like), set `Skeleton - Visuals` → `Body Model Enabled` to off and Skeletons keep the vanilla body. Abilities stay the same.
|
||||
- **Show Helmet:** turn on `Skeleton - Visuals` → `Show Helmet` and your helmet sits on the skull. Off by default; other players see it the way you picked.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue