chore(release): v1.5.5 - Sverm Gjall bombs spare the player and the ticks they hatch are tame
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9a3ab78666
commit
5113225981
5 changed files with 114 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "RacesOfValheim",
|
||||
"description": "A Valheim mod that adds ten custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Sverm, Trenta, Trol) each with unique abilities, traits, race stations and a deep boss-driven progression system.",
|
||||
"version_number": "1.5.4",
|
||||
"version_number": "1.5.5",
|
||||
"website_url": "",
|
||||
"dependencies": [
|
||||
"denikson-BepInExPack_Valheim-5.4.2333",
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace RacesOfValheim
|
|||
{
|
||||
public const string PluginGUID = "com.nandor.racesofvalheim";
|
||||
public const string PluginName = "Races Of Valheim";
|
||||
public const string PluginVersion = "1.5.4";
|
||||
public const string PluginVersion = "1.5.5";
|
||||
|
||||
private readonly Harmony harmony = new Harmony(PluginGUID);
|
||||
|
||||
|
|
|
|||
102
JotunnModStub/Sverm/SvermGjallPatches.cs
Normal file
102
JotunnModStub/Sverm/SvermGjallPatches.cs
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RacesOfValheim
|
||||
{
|
||||
/// <summary>
|
||||
/// What a Sverm Gjall's bombs do once they land: no friendly fire, and the ticks they hatch are ours.
|
||||
///
|
||||
/// Two reports in one. The Gjall's bile bomb is an AOE projectile, and Projectile.DoAOE (read off
|
||||
/// the IL) only spares a victim when m_noDamageFriendly is set on the projectile - the vanilla
|
||||
/// Gjall never needed it, because nothing it fights has friends. Ours has the player, so a bomb
|
||||
/// aimed at a turtle killed the player on a boat beside it. And the ticks the bomb spawns
|
||||
/// (Projectile.SpawnOnHit) are plain wild Ticks, hostile to everyone, the Gjall that threw them
|
||||
/// included.
|
||||
///
|
||||
/// Both are keyed on the projectile's owner being a Sverm troop (a RaisedThrall that answers to the
|
||||
/// Sverm race), so a wild Gjall in the Mistlands behaves exactly as before.
|
||||
/// </summary>
|
||||
public static class SvermGjallPatches
|
||||
{
|
||||
/// <summary>How long a hatched tick lives. Wild ones never despawn, and ours would pile up.</summary>
|
||||
private const float TickLifetime = 45f;
|
||||
|
||||
private static bool IsSvermTroop(Character owner)
|
||||
{
|
||||
if (owner == null) return false;
|
||||
RaisedThrall thrall = owner.GetComponent<RaisedThrall>();
|
||||
return thrall != null && thrall.m_commandingRace == SvermConfig.RaceId;
|
||||
}
|
||||
|
||||
// ── Friendly fire ────────────────────────────────────────────────────
|
||||
|
||||
[HarmonyPatch(typeof(Projectile), nameof(Projectile.Setup))]
|
||||
public static class Sverm_Projectile_Setup_Patch
|
||||
{
|
||||
public static void Postfix(Projectile __instance, Character ___m_owner)
|
||||
{
|
||||
if (IsSvermTroop(___m_owner)) __instance.m_noDamageFriendly = true;
|
||||
}
|
||||
}
|
||||
|
||||
// ── The ticks ────────────────────────────────────────────────────────
|
||||
|
||||
// Characters that came to life while a Sverm projectile was spawning its payload. Awake has
|
||||
// run on every component by the time SpawnOnHit returns, which is when they are tamed.
|
||||
private static bool collecting;
|
||||
private static readonly List<Character> born = new List<Character>();
|
||||
|
||||
[HarmonyPatch(typeof(Projectile), "SpawnOnHit")]
|
||||
public static class Sverm_Projectile_SpawnOnHit_Patch
|
||||
{
|
||||
public static void Prefix(Character ___m_owner)
|
||||
{
|
||||
born.Clear();
|
||||
collecting = IsSvermTroop(___m_owner);
|
||||
}
|
||||
|
||||
public static void Postfix()
|
||||
{
|
||||
collecting = false;
|
||||
|
||||
foreach (Character spawned in born)
|
||||
{
|
||||
if (spawned == null || spawned.IsPlayer() || spawned.IsDead()) continue;
|
||||
|
||||
spawned.SetTamed(true);
|
||||
spawned.gameObject.AddComponent<SvermGjallTickLife>().m_seconds = TickLifetime;
|
||||
}
|
||||
born.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(Character), "Awake")]
|
||||
public static class Sverm_Character_Awake_Patch
|
||||
{
|
||||
public static void Postfix(Character __instance)
|
||||
{
|
||||
if (collecting) born.Add(__instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A tick born of a Sverm Gjall's bomb: tame, and gone after a short while.</summary>
|
||||
public class SvermGjallTickLife : MonoBehaviour
|
||||
{
|
||||
public float m_seconds = 45f;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Invoke(nameof(Expire), m_seconds);
|
||||
}
|
||||
|
||||
private void Expire()
|
||||
{
|
||||
ZNetView nview = GetComponent<ZNetView>();
|
||||
if (nview == null || !nview.IsValid() || !nview.IsOwner()) return;
|
||||
|
||||
ZNetScene.instance.Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -13,6 +13,10 @@ Support the mod: [Patreon — NandorTheModder](https://www.patreon.com/c/NandorT
|
|||
|
||||
---
|
||||
|
||||
## New in v1.5.5
|
||||
|
||||
A Sverm Gjall no longer kills you with its own bombs, and the ticks it hatches are on your side. Full details in the [changelog](#v155).
|
||||
|
||||
## New in v1.5.4
|
||||
|
||||
Sverm troops no longer crowd you. Following soldiers used to run onto your exact spot, shove each other and push you around, even into the water, and on a boat they drove into the hull and spun it in circles. Each one now keeps its own place around you, and around the hull when you sail. Full details in the [changelog](#v154).
|
||||
|
|
@ -439,6 +443,11 @@ Both halves have an off switch under `Factions` in Configuration Manager: **Fact
|
|||
|
||||
## Changelog
|
||||
|
||||
### v1.5.5
|
||||
- **Fix - a Sverm Gjall's bombs hurt the player:** the Gjall's bile bomb damages everything in its blast unless the projectile is flagged as non-friendly-damaging, which a wild Gjall never needed. A bomb thrown at a turtle killed a player on a boat beside it. Bombs thrown by a Sverm troop now spare the player and the player's tames; wild creatures still take the damage.
|
||||
- **Fix - the ticks a Sverm Gjall hatches were hostile to everyone:** they were ordinary wild ticks and attacked the player, the tames and the Gjall itself. Ticks hatched by a Sverm Gjall's bomb are now tame, and disappear after 45 seconds. A wild Gjall is unchanged. Thanks to the player who reported it.
|
||||
- **Not tested in game yet.**
|
||||
|
||||
### v1.5.4
|
||||
- **Fix - Sverm troops piled onto the player and pushed boats around:** the game sends every follower to the exact spot where you stand and stops it three metres away, so a squad of three converged on one point, shoved each other and shoved you, in one report into the water. On a boat your spot is on the deck, so they drove into the hull and spun the ship in circles. Each troop now has its own place, about 4 m behind you and fanned out from the others, and only walks back to it once it has drifted 3 m away, so it stands still instead of shuffling. While you are on a ship the places lie on a ring 5 m outside the hull. Past 30 m from you a troop stops following and goes home to its nest. Thralls, the Aswid's thralls and skeletons keep the game's own following. Thanks to the player who reported it.
|
||||
- **Not tested in game yet:** the distances are estimates, and `SvermConfig` holds them if they need tuning.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "RacesOfValheim",
|
||||
"description": "A Valheim mod that adds ten custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Sverm, Trenta, Trol) each with unique abilities, traits, race stations and a deep boss-driven progression system.",
|
||||
"version_number": "1.5.4",
|
||||
"version_number": "1.5.5",
|
||||
"website_url": "",
|
||||
"dependencies": [
|
||||
"denikson-BepInExPack_Valheim-5.4.2333",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue