chore(release): v1.4.21 - dragon form multiplayer sync, Sverm Ravager networking, dorsal spine fix
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
6499eb71df
commit
e7325e4d25
12 changed files with 303 additions and 10 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "RacesOfValheim",
|
"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.",
|
"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.4.20",
|
"version_number": "1.4.21",
|
||||||
"website_url": "",
|
"website_url": "",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"denikson-BepInExPack_Valheim-5.4.2333",
|
"denikson-BepInExPack_Valheim-5.4.2333",
|
||||||
|
|
|
||||||
|
|
@ -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.4.20";
|
public const string PluginVersion = "1.4.21";
|
||||||
|
|
||||||
private readonly Harmony harmony = new Harmony(PluginGUID);
|
private readonly Harmony harmony = new Harmony(PluginGUID);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,14 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Read by RemoteSkadiAnimator (SkadiPatches.cs) so other clients' copy of the form actually
|
||||||
|
// plays the bite/claw/breath clip instead of just locomotion. The suffix is a running count,
|
||||||
|
// not just the trigger name, because the same attack (e.g. two bites in a row) has to look
|
||||||
|
// like a NEW event to a remote client diffing the ZDO string - an unchanged value never
|
||||||
|
// re-triggers a Unity Animator trigger parameter.
|
||||||
|
public const string AttackTriggerKey = "RacesOfValheim_SkadiAttackTrigger";
|
||||||
|
private static int attackTriggerSeq = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Animator.SetTrigger on a name the controller does not have is silently ignored by Unity,
|
/// Animator.SetTrigger on a name the controller does not have is silently ignored by Unity,
|
||||||
/// so a wrong trigger looks exactly like "the animation did not play" with nothing in the
|
/// so a wrong trigger looks exactly like "the animation did not play" with nothing in the
|
||||||
|
|
@ -120,6 +128,13 @@ namespace RacesOfValheim
|
||||||
if (p.type == AnimatorControllerParameterType.Trigger && p.name == trigger)
|
if (p.type == AnimatorControllerParameterType.Trigger && p.name == trigger)
|
||||||
{
|
{
|
||||||
anim.SetTrigger(trigger);
|
anim.SetTrigger(trigger);
|
||||||
|
|
||||||
|
ZNetView nview = Player.m_localPlayer?.GetComponent<ZNetView>();
|
||||||
|
if (nview != null && nview.IsValid())
|
||||||
|
{
|
||||||
|
attackTriggerSeq++;
|
||||||
|
nview.GetZDO().Set(AttackTriggerKey, trigger + "#" + attackTriggerSeq);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,10 @@ namespace RacesOfValheim
|
||||||
formInstance.name = wanted;
|
formInstance.name = wanted;
|
||||||
formInstance.transform.localPosition = formName == "Hatchling" ? new Vector3(0f, -1.0f, 0f) : Vector3.zero;
|
formInstance.transform.localPosition = formName == "Hatchling" ? new Vector3(0f, -1.0f, 0f) : Vector3.zero;
|
||||||
formInstance.transform.localRotation = Quaternion.identity;
|
formInstance.transform.localRotation = Quaternion.identity;
|
||||||
|
// Same config-driven size the transforming player's own client applies (see
|
||||||
|
// SkadiRace.GetFormScale) - without it every remote observer saw the prefab's
|
||||||
|
// raw 1x Visual scale, Moder's ModerScale shrink included.
|
||||||
|
formInstance.transform.localScale = SkadiRace.GetFormScaleForPrefab(formName);
|
||||||
|
|
||||||
if (formInstance.GetComponent<RemoteSkadiAnimator>() == null)
|
if (formInstance.GetComponent<RemoteSkadiAnimator>() == null)
|
||||||
{
|
{
|
||||||
|
|
@ -94,12 +98,24 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
private Animator anim;
|
private Animator anim;
|
||||||
private Player player;
|
private Player player;
|
||||||
|
private ZNetView nview;
|
||||||
|
|
||||||
|
// Seeded from whatever the ZDO already holds in Start, not "", so a value left over from an
|
||||||
|
// earlier transformation on this same player does not read as a brand-new attack the moment
|
||||||
|
// this component is built and replay a stale trigger on entry.
|
||||||
|
private string lastAttackTrigger;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
anim = GetComponent<Animator>();
|
anim = GetComponent<Animator>();
|
||||||
if (anim == null) anim = GetComponentInChildren<Animator>();
|
if (anim == null) anim = GetComponentInChildren<Animator>();
|
||||||
player = GetComponentInParent<Player>();
|
player = GetComponentInParent<Player>();
|
||||||
|
nview = player != null ? player.GetComponent<ZNetView>() : null;
|
||||||
|
|
||||||
|
if (nview != null && nview.IsValid())
|
||||||
|
{
|
||||||
|
lastAttackTrigger = nview.GetZDO().GetString(DrakeFormBehavior.AttackTriggerKey, "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
|
|
@ -115,6 +131,29 @@ namespace RacesOfValheim
|
||||||
Vector3 vel = player.GetVelocity();
|
Vector3 vel = player.GetVelocity();
|
||||||
vel.y = 0f;
|
vel.y = 0f;
|
||||||
anim.SetFloat("forward_speed", vel.magnitude);
|
anim.SetFloat("forward_speed", vel.magnitude);
|
||||||
|
|
||||||
|
// The bite/claw/breath trigger DrakeFormBehavior fires on the transforming player's own
|
||||||
|
// client - without this, remote observers only ever saw locomotion, never an attack play.
|
||||||
|
if (nview != null && nview.IsValid())
|
||||||
|
{
|
||||||
|
string current = nview.GetZDO().GetString(DrakeFormBehavior.AttackTriggerKey, "");
|
||||||
|
if (!string.IsNullOrEmpty(current) && current != lastAttackTrigger)
|
||||||
|
{
|
||||||
|
lastAttackTrigger = current;
|
||||||
|
|
||||||
|
int seqAt = current.LastIndexOf('#');
|
||||||
|
string trigger = seqAt >= 0 ? current.Substring(0, seqAt) : current;
|
||||||
|
|
||||||
|
foreach (AnimatorControllerParameter p in anim.parameters)
|
||||||
|
{
|
||||||
|
if (p.type == AnimatorControllerParameterType.Trigger && p.name == trigger)
|
||||||
|
{
|
||||||
|
anim.SetTrigger(trigger);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -600,6 +600,18 @@ namespace RacesOfValheim
|
||||||
return Vector3.one * SkadiConfig.DrakeScale.Value; // Drake
|
return Vector3.one * SkadiConfig.DrakeScale.Value; // Drake
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Same lookup, keyed by the prefab name the ZDO actually carries ("RacesOfValheim_SkadiForm"),
|
||||||
|
// so Skadi_MultiplayerVisuals_Patch can size a remote observer's copy of the form the same way
|
||||||
|
// the transforming player's own client does. Without this the remote instance was left at the
|
||||||
|
// prefab's raw Visual scale (1x) no matter which form or config value was in play - Moder's
|
||||||
|
// ModerScale nerf, in particular, only ever applied on the transformed player's own screen.
|
||||||
|
public static Vector3 GetFormScaleForPrefab(string prefabName)
|
||||||
|
{
|
||||||
|
if (prefabName == "Dragon") return Vector3.one * SkadiConfig.ModerScale.Value;
|
||||||
|
if (prefabName == "Fader") return Vector3.one * SkadiConfig.FaderScale.Value;
|
||||||
|
return Vector3.one * SkadiConfig.DrakeScale.Value; // Hatchling
|
||||||
|
}
|
||||||
|
|
||||||
private IEnumerator TransformRoutine(SkadiProgression.FormRules rules)
|
private IEnumerator TransformRoutine(SkadiProgression.FormRules rules)
|
||||||
{
|
{
|
||||||
isTransformingSequence = true;
|
isTransformingSequence = true;
|
||||||
|
|
|
||||||
|
|
@ -192,8 +192,8 @@ namespace RacesOfValheim
|
||||||
// it is a real prefab that resolves by name, and it reads as xenomorph spines rather than
|
// it is a real prefab that resolves by name, and it reads as xenomorph spines rather than
|
||||||
// as a bird.
|
// as a bird.
|
||||||
public const string SpinesPrefab = "UndeadBjornRibcage";
|
public const string SpinesPrefab = "UndeadBjornRibcage";
|
||||||
public static readonly float SpineSizeSmall = 0.45f; // metres, state 5-6
|
public static readonly float SpineSizeSmall = 0.315f; // metres, state 5-6 (0.45 * 0.7)
|
||||||
public static readonly float SpineSizeFull = 0.80f; // metres, state 7+
|
public static readonly float SpineSizeFull = 0.56f; // metres, state 7+ (0.80 * 0.7)
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Which bone they ride. Spine2 and ONLY Spine2 - no fallback chain.
|
/// Which bone they ride. Spine2 and ONLY Spine2 - no fallback chain.
|
||||||
///
|
///
|
||||||
|
|
@ -214,6 +214,11 @@ namespace RacesOfValheim
|
||||||
public static readonly float SpineRotationY = -90f;
|
public static readonly float SpineRotationY = -90f;
|
||||||
public static readonly float SpineRotationZ = 90f;
|
public static readonly float SpineRotationZ = 90f;
|
||||||
|
|
||||||
|
// No extra nudge by default - ApplySpines already centres the crest on the bone (half its
|
||||||
|
// own height each way) before this is added, which is what keeps the Full-Crest size from
|
||||||
|
// reaching up over the head the way basing the whole thing at the bone once did.
|
||||||
|
public static readonly float SpineOffsetY = 0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// What holds a falling Sverm up: the Mistlands' own fireflies, swarming under the body.
|
/// What holds a falling Sverm up: the Mistlands' own fireflies, swarming under the body.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ namespace RacesOfValheim
|
||||||
public static ConfigEntry<float> SpineRotationX;
|
public static ConfigEntry<float> SpineRotationX;
|
||||||
public static ConfigEntry<float> SpineRotationY;
|
public static ConfigEntry<float> SpineRotationY;
|
||||||
public static ConfigEntry<float> SpineRotationZ;
|
public static ConfigEntry<float> SpineRotationZ;
|
||||||
|
public static ConfigEntry<float> SpineOffsetY;
|
||||||
|
|
||||||
// ─── Emberform ───────────────────────────────────────────────────────
|
// ─── Emberform ───────────────────────────────────────────────────────
|
||||||
public static ConfigEntry<float> EmberGlowStrength;
|
public static ConfigEntry<float> EmberGlowStrength;
|
||||||
|
|
@ -255,6 +256,17 @@ namespace RacesOfValheim
|
||||||
SpineRotationX = config.Bind(spines, "Rotation X", SvermConfig.SpineRotationX, "Pitch of the spines, in degrees.");
|
SpineRotationX = config.Bind(spines, "Rotation X", SvermConfig.SpineRotationX, "Pitch of the spines, in degrees.");
|
||||||
SpineRotationY = config.Bind(spines, "Rotation Y", SvermConfig.SpineRotationY, "Yaw of the spines, in degrees.");
|
SpineRotationY = config.Bind(spines, "Rotation Y", SvermConfig.SpineRotationY, "Yaw of the spines, in degrees.");
|
||||||
SpineRotationZ = config.Bind(spines, "Rotation Z", SvermConfig.SpineRotationZ, "Roll of the spines, in degrees.");
|
SpineRotationZ = config.Bind(spines, "Rotation Z", SvermConfig.SpineRotationZ, "Roll of the spines, in degrees.");
|
||||||
|
|
||||||
|
// FOUND IN PLAY: at Size Full (0.8 m) the crest reached up past the shoulders and onto
|
||||||
|
// the head - ModelBorrow.Attach grounds a borrowed model's BOTTOM at the mount point and
|
||||||
|
// grows it from there, and Spine2's own local up axis runs toward the head, not out and
|
||||||
|
// away from the back. ApplySpines now centres the crest on the bone by default (half its
|
||||||
|
// height below the mount point, half above) instead of basing the whole thing there, which
|
||||||
|
// is a size-aware correction rather than a guess; this is purely an extra nudge on top of
|
||||||
|
// that, in metres along the same axis, for whatever an eye still wants adjusted.
|
||||||
|
SpineOffsetY = config.Bind(spines, "Offset Y", SvermConfig.SpineOffsetY,
|
||||||
|
"Extra nudge along the mount bone's own up axis, in metres, on top of the automatic " +
|
||||||
|
"centring. Positive moves the crest toward the head, negative toward the tail.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── Live reads ──────────────────────────────────────────────────────
|
// ─── Live reads ──────────────────────────────────────────────────────
|
||||||
|
|
@ -269,6 +281,8 @@ namespace RacesOfValheim
|
||||||
SpineRotationZ?.Value ?? SvermConfig.SpineRotationZ);
|
SpineRotationZ?.Value ?? SvermConfig.SpineRotationZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static float SpineOffset => SpineOffsetY?.Value ?? SvermConfig.SpineOffsetY;
|
||||||
|
|
||||||
public static float EmberStrength => EmberGlowStrength?.Value ?? SvermConfig.EmberGlowStrength;
|
public static float EmberStrength => EmberGlowStrength?.Value ?? SvermConfig.EmberGlowStrength;
|
||||||
|
|
||||||
public static int Brood => CapBrood?.Value ?? SvermConfig.CapBrood;
|
public static int Brood => CapBrood?.Value ?? SvermConfig.CapBrood;
|
||||||
|
|
|
||||||
|
|
@ -310,6 +310,141 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ─── Ravager Strain (remote observers) ──────────────────────────────
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Mirrors SvermRavagerForm.Enter/Exit for every OTHER client, the same way
|
||||||
|
/// Skadi_MultiplayerVisuals_Patch mirrors SkadiRace's dragon forms. SvermRavagerForm itself
|
||||||
|
/// only ever touches Player.m_localPlayer - Tick(), Enter() and RavagerFormBehavior are all
|
||||||
|
/// built around it - so without this an observer's client never knew the form was up at
|
||||||
|
/// all: no model, no hidden human body, nothing standing in for the Brute.
|
||||||
|
/// </summary>
|
||||||
|
[HarmonyPatch(typeof(VisEquipment), "UpdateVisuals")]
|
||||||
|
public static class Sverm_RavagerRemoteVisuals_Patch
|
||||||
|
{
|
||||||
|
private const string RemoteModelName = "SvermRavagerRemoteModel";
|
||||||
|
|
||||||
|
public static void Postfix(VisEquipment __instance)
|
||||||
|
{
|
||||||
|
if (__instance == null || !__instance.m_isPlayer) return;
|
||||||
|
|
||||||
|
Player player = __instance.GetComponent<Player>();
|
||||||
|
if (player == null || player.IsOwner()) return; // Local player: SvermRavagerForm handles itself.
|
||||||
|
|
||||||
|
if (!SvermVisuals.IsSvermPlayer(player)) return;
|
||||||
|
|
||||||
|
ZNetView nview = player.GetComponent<ZNetView>();
|
||||||
|
if (nview == null || !nview.IsValid()) return;
|
||||||
|
|
||||||
|
bool active = nview.GetZDO().GetBool(SvermRavagerForm.ActiveKey, false);
|
||||||
|
Transform existing = player.transform.Find(RemoteModelName);
|
||||||
|
Transform playerVisual = player.transform.Find("Visual");
|
||||||
|
|
||||||
|
if (!active)
|
||||||
|
{
|
||||||
|
if (existing != null)
|
||||||
|
{
|
||||||
|
Object.Destroy(existing.gameObject);
|
||||||
|
PlayerVisualHider.Show(playerVisual, "sverm-ravager-remote-revert");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (existing == null)
|
||||||
|
{
|
||||||
|
GameObject model = SvermRavagerForm.SpawnRemoteModel(player.transform);
|
||||||
|
if (model != null)
|
||||||
|
{
|
||||||
|
model.name = RemoteModelName;
|
||||||
|
model.AddComponent<RemoteRavagerAnimator>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PlayerVisualHider.Hide(playerVisual, "sverm-ravager-remote");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// RemoteSkadiAnimator's counterpart for the Ravager Strain: locomotion off the replicated
|
||||||
|
/// Character, plus the bite/ram/slam/taunt trigger RavagerFormBehavior publishes through
|
||||||
|
/// SvermRavagerForm.PublishAttackTrigger. LateUpdate re-hides the player's own Visual every
|
||||||
|
/// frame for the same reason RavagerFormBehavior does on the local client - any nearby
|
||||||
|
/// equipment rebuild (VisEquipment's own refresh path) makes a hidden body visible again.
|
||||||
|
/// </summary>
|
||||||
|
public class RemoteRavagerAnimator : MonoBehaviour
|
||||||
|
{
|
||||||
|
private Animator anim;
|
||||||
|
private Player player;
|
||||||
|
private ZNetView nview;
|
||||||
|
private bool hasForwardSpeed;
|
||||||
|
private bool hasOnGround;
|
||||||
|
|
||||||
|
// Seeded from the ZDO's current value in Start, not "", so a trigger left over from an
|
||||||
|
// earlier Ravager Strain on this same player does not replay the instant this
|
||||||
|
// component is built.
|
||||||
|
private string lastAttackTrigger;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
anim = GetComponentInChildren<Animator>();
|
||||||
|
player = GetComponentInParent<Player>();
|
||||||
|
nview = player != null ? player.GetComponent<ZNetView>() : null;
|
||||||
|
|
||||||
|
if (anim != null)
|
||||||
|
{
|
||||||
|
foreach (AnimatorControllerParameter p in anim.parameters)
|
||||||
|
{
|
||||||
|
if (p.type == AnimatorControllerParameterType.Float && p.name == "forward_speed") hasForwardSpeed = true;
|
||||||
|
else if (p.type == AnimatorControllerParameterType.Bool && p.name == "onGround") hasOnGround = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nview != null && nview.IsValid())
|
||||||
|
{
|
||||||
|
lastAttackTrigger = nview.GetZDO().GetString(SvermRavagerForm.AttackTriggerKey, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LateUpdate()
|
||||||
|
{
|
||||||
|
if (player == null) return;
|
||||||
|
PlayerVisualHider.Hide(player.transform.Find("Visual"), "sverm-ravager-remote");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (anim == null || player == null) return;
|
||||||
|
|
||||||
|
if (hasForwardSpeed)
|
||||||
|
{
|
||||||
|
Vector3 vel = player.GetVelocity();
|
||||||
|
vel.y = 0f;
|
||||||
|
anim.SetFloat("forward_speed", vel.magnitude);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasOnGround) anim.SetBool("onGround", player.IsOnGround());
|
||||||
|
|
||||||
|
if (nview == null || !nview.IsValid()) return;
|
||||||
|
|
||||||
|
string current = nview.GetZDO().GetString(SvermRavagerForm.AttackTriggerKey, "");
|
||||||
|
if (string.IsNullOrEmpty(current) || current == lastAttackTrigger) return;
|
||||||
|
|
||||||
|
lastAttackTrigger = current;
|
||||||
|
|
||||||
|
int seqAt = current.LastIndexOf('#');
|
||||||
|
string trigger = seqAt >= 0 ? current.Substring(0, seqAt) : current;
|
||||||
|
|
||||||
|
foreach (AnimatorControllerParameter p in anim.parameters)
|
||||||
|
{
|
||||||
|
if (p.type == AnimatorControllerParameterType.Trigger && p.name == trigger)
|
||||||
|
{
|
||||||
|
anim.SetTrigger(trigger);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ─── Spawn ───────────────────────────────────────────────────────────
|
// ─── Spawn ───────────────────────────────────────────────────────────
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,18 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
public static bool IsActive { get; private set; }
|
public static bool IsActive { get; private set; }
|
||||||
|
|
||||||
|
// Read by Sverm_RavagerRemoteVisuals_Patch (SvermPatches.cs) so every other client can
|
||||||
|
// tell the form is up at all - without this the whole thing was local-only, exactly like
|
||||||
|
// DrakeFormBehavior's flight flag and Fenrir's own form key, and other players saw nothing
|
||||||
|
// but a Sverm standing still for the whole two minutes.
|
||||||
|
public const string ActiveKey = "RacesOfValheim_SvermRavagerForm";
|
||||||
|
|
||||||
|
// Same running-count trick as DrakeFormBehavior.AttackTriggerKey: the trigger name alone
|
||||||
|
// cannot tell a remote client "a new bite just happened" when the same trigger fires twice
|
||||||
|
// in a row, since an unchanged ZDO string never re-fires a Unity Animator trigger.
|
||||||
|
public const string AttackTriggerKey = "RacesOfValheim_SvermRavagerAttack";
|
||||||
|
private static int attackTriggerSeq = 0;
|
||||||
|
|
||||||
private static GameObject model;
|
private static GameObject model;
|
||||||
private static float expiresAt;
|
private static float expiresAt;
|
||||||
private static float nextAllowedAt;
|
private static float nextAllowedAt;
|
||||||
|
|
@ -214,6 +226,9 @@ namespace RacesOfValheim
|
||||||
IsActive = true;
|
IsActive = true;
|
||||||
expiresAt = Time.time + SvermConfig.RavagerDurationSeconds;
|
expiresAt = Time.time + SvermConfig.RavagerDurationSeconds;
|
||||||
|
|
||||||
|
ZNetView nview = player.GetComponent<ZNetView>();
|
||||||
|
if (nview != null && nview.IsValid()) nview.GetZDO().Set(ActiveKey, true);
|
||||||
|
|
||||||
player.GetSEMan().AddStatusEffect(SvermConfig.RavagerSE.GetStableHashCode(), true);
|
player.GetSEMan().AddStatusEffect(SvermConfig.RavagerSE.GetStableHashCode(), true);
|
||||||
|
|
||||||
Transform visual = player.transform.Find("Visual");
|
Transform visual = player.transform.Find("Visual");
|
||||||
|
|
@ -289,6 +304,9 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
IsActive = false;
|
IsActive = false;
|
||||||
|
|
||||||
|
ZNetView exitNview = player.GetComponent<ZNetView>();
|
||||||
|
if (exitNview != null && exitNview.IsValid()) exitNview.GetZDO().Set(ActiveKey, false);
|
||||||
|
|
||||||
PlayEffect(SvermConfig.RavagerMorphOutEffects, player.transform.position);
|
PlayEffect(SvermConfig.RavagerMorphOutEffects, player.transform.position);
|
||||||
|
|
||||||
// Nothing was ever equipped for this form - see the class doc for why - so there is
|
// Nothing was ever equipped for this form - see the class doc for why - so there is
|
||||||
|
|
@ -382,6 +400,40 @@ namespace RacesOfValheim
|
||||||
if (target != null) target.transform.localScale = to;
|
if (target != null) target.transform.localScale = to;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ─── Remote observers ───────────────────────────────────────────────
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Builds the same costume Enter() does, minus the grow-in tween (a remote observer just
|
||||||
|
/// needs the steady-state model, not the entrance) and minus RavagerFormBehavior, which is
|
||||||
|
/// built around Player.m_localPlayer and would do nothing useful on a copy driven by
|
||||||
|
/// someone else's client. Sverm_RavagerRemoteVisuals_Patch adds RemoteRavagerAnimator
|
||||||
|
/// instead, the same way Skadi_MultiplayerVisuals_Patch adds RemoteSkadiAnimator.
|
||||||
|
/// </summary>
|
||||||
|
public static GameObject SpawnRemoteModel(Transform playerTransform)
|
||||||
|
{
|
||||||
|
if (template == null) return null;
|
||||||
|
|
||||||
|
GameObject model = Object.Instantiate(template, playerTransform.position, playerTransform.rotation, playerTransform);
|
||||||
|
model.transform.localPosition = Vector3.zero;
|
||||||
|
model.transform.localScale = template.transform.localScale * SvermConfigManagement.RavagerScale;
|
||||||
|
model.transform.localRotation = Quaternion.Euler(0f, SvermConfigManagement.RavagerYaw, 0f);
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called by RavagerFormBehavior right after it fires a trigger on the local player's own
|
||||||
|
/// copy of the Animator, so RemoteRavagerAnimator can replay the same clip on every other
|
||||||
|
/// client. See AttackTriggerKey for why a sequence number rides along with the name.
|
||||||
|
/// </summary>
|
||||||
|
public static void PublishAttackTrigger(Player player, string trigger)
|
||||||
|
{
|
||||||
|
ZNetView nview = player != null ? player.GetComponent<ZNetView>() : null;
|
||||||
|
if (nview == null || !nview.IsValid()) return;
|
||||||
|
|
||||||
|
attackTriggerSeq++;
|
||||||
|
nview.GetZDO().Set(AttackTriggerKey, trigger + "#" + attackTriggerSeq);
|
||||||
|
}
|
||||||
|
|
||||||
// ─── The three attacks ───────────────────────────────────────────────
|
// ─── The three attacks ───────────────────────────────────────────────
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -584,6 +636,7 @@ namespace RacesOfValheim
|
||||||
if (!string.IsNullOrEmpty(profile.Trigger) && knownTriggers.Contains(profile.Trigger))
|
if (!string.IsNullOrEmpty(profile.Trigger) && knownTriggers.Contains(profile.Trigger))
|
||||||
{
|
{
|
||||||
anim.SetTrigger(profile.Trigger);
|
anim.SetTrigger(profile.Trigger);
|
||||||
|
SvermRavagerForm.PublishAttackTrigger(Player.m_localPlayer, profile.Trigger);
|
||||||
}
|
}
|
||||||
|
|
||||||
yield return new WaitForSeconds(hitDelay);
|
yield return new WaitForSeconds(hitDelay);
|
||||||
|
|
@ -614,6 +667,7 @@ namespace RacesOfValheim
|
||||||
if (!string.IsNullOrEmpty(profile.Trigger) && knownTriggers.Contains(profile.Trigger))
|
if (!string.IsNullOrEmpty(profile.Trigger) && knownTriggers.Contains(profile.Trigger))
|
||||||
{
|
{
|
||||||
anim.SetTrigger(profile.Trigger);
|
anim.SetTrigger(profile.Trigger);
|
||||||
|
SvermRavagerForm.PublishAttackTrigger(Player.m_localPlayer, profile.Trigger);
|
||||||
}
|
}
|
||||||
|
|
||||||
PlaySound(SvermConfig.RavagerTauntSoundEffects);
|
PlaySound(SvermConfig.RavagerTauntSoundEffects);
|
||||||
|
|
|
||||||
|
|
@ -454,9 +454,19 @@ namespace RacesOfValheim
|
||||||
// metres and degrees - what was ASKED for - not bone-local numbers.
|
// metres and degrees - what was ASKED for - not bone-local numbers.
|
||||||
Quaternion wantedRotation = SvermConfigManagement.SpineRotation();
|
Quaternion wantedRotation = SvermConfigManagement.SpineRotation();
|
||||||
|
|
||||||
|
// Basing the whole crest AT the bone and growing it upward (ModelBorrow.Attach grounds
|
||||||
|
// a borrowed model's bottom at the mount point) reached up past the shoulders and onto
|
||||||
|
// the head once the crest got tall - Spine2's own local up axis runs toward the head,
|
||||||
|
// not out and away from the back. Centring it on the bone instead - half its height
|
||||||
|
// below the mount point, half above - keeps the same rotation an eye already approved
|
||||||
|
// while stopping the Full Crest size from overshooting. SpineOffsetY is an additional
|
||||||
|
// nudge along the same axis, for whatever still needs adjusting by eye.
|
||||||
|
float wantedOffsetY = -wanted / 2f + SvermConfigManagement.SpineOffset;
|
||||||
|
|
||||||
SvermSpineTag tag = existing != null ? existing.GetComponent<SvermSpineTag>() : null;
|
SvermSpineTag tag = existing != null ? existing.GetComponent<SvermSpineTag>() : null;
|
||||||
if (existing != null && (tag == null
|
if (existing != null && (tag == null
|
||||||
|| !Mathf.Approximately(tag.Size, wanted)
|
|| !Mathf.Approximately(tag.Size, wanted)
|
||||||
|
|| !Mathf.Approximately(tag.OffsetY, wantedOffsetY)
|
||||||
|| Quaternion.Angle(tag.Rotation, wantedRotation) > 0.5f))
|
|| Quaternion.Angle(tag.Rotation, wantedRotation) > 0.5f))
|
||||||
{
|
{
|
||||||
existing.name = SpinesName + "_Removed";
|
existing.name = SpinesName + "_Removed";
|
||||||
|
|
@ -474,7 +484,7 @@ namespace RacesOfValheim
|
||||||
bone,
|
bone,
|
||||||
SpinesName,
|
SpinesName,
|
||||||
SvermConfig.SpinesPrefab,
|
SvermConfig.SpinesPrefab,
|
||||||
Vector3.zero,
|
new Vector3(0f, wantedOffsetY / lossy, 0f),
|
||||||
wantedRotation,
|
wantedRotation,
|
||||||
wanted / lossy,
|
wanted / lossy,
|
||||||
"Sverm");
|
"Sverm");
|
||||||
|
|
@ -484,6 +494,7 @@ namespace RacesOfValheim
|
||||||
SvermSpineTag built = holder.AddComponent<SvermSpineTag>();
|
SvermSpineTag built = holder.AddComponent<SvermSpineTag>();
|
||||||
built.Size = wanted;
|
built.Size = wanted;
|
||||||
built.Rotation = wantedRotation;
|
built.Rotation = wantedRotation;
|
||||||
|
built.OffsetY = wantedOffsetY;
|
||||||
existing = holder.transform;
|
existing = holder.transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -532,6 +543,7 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
public float Size;
|
public float Size;
|
||||||
public Quaternion Rotation = Quaternion.identity;
|
public Quaternion Rotation = Quaternion.identity;
|
||||||
|
public float OffsetY;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── Glide motes ─────────────────────────────────────────────────────
|
// ─── Glide motes ─────────────────────────────────────────────────────
|
||||||
|
|
|
||||||
|
|
@ -412,6 +412,13 @@ Both halves have an off switch under `Factions` in Configuration Manager: **Fact
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### v1.4.21
|
||||||
|
- **Fix - Other players saw Moder, the Drake and Fader at full size no matter what:** the dragon forms' own size (Moder's shrink included) was only ever applied on the transformed player's own screen — every other client built the remote copy at the prefab's raw scale. Two Skadi players who both turned into Moder each saw themselves correctly and the other one full-sized. Thanks to the tester who caught it from a second Skadi.
|
||||||
|
- **Fix - Drake and Moder's bite, claw and breath attacks played no animation for onlookers:** the attack trigger was only ever set on the transforming player's own Animator, so everyone else saw the form fly, walk and idle but never actually swing or breathe. The trigger now reaches every other client too.
|
||||||
|
- **Fix - Sverm Ravager Strain was invisible to everyone but the player using it:** the whole form — the model, the hidden human body, the attacks — was built entirely around the local player and never told the ZDO it was active. Other players saw a Sverm standing still for the whole two minutes with no Brute in sight. It is now networked the same way the Skadi and Fenrir forms already are.
|
||||||
|
- **Fix - The Sverm's dorsal spines were mounted up over the shoulders, onto the face:** the crest was based at its mount bone and grown upward from there, which reached past the head once the Full Crest size (Queen tier on) came in. It is now centred on the bone instead, with a live "Offset Y" knob under `[Sverm - Dorsal Spines]` in Configuration Manager for any further nudging. Thanks to the tester who sent the screenshot.
|
||||||
|
- **Changed - The Sverm's dorsal spines are 30% smaller:** 0.45 m down to 0.315 m from Moder to the Queen, 0.8 m down to 0.56 m from the Queen on.
|
||||||
|
|
||||||
### v1.4.20
|
### v1.4.20
|
||||||
- **Fix - A refused race building still took your materials:** building something your race is not allowed to build, or before its boss has fallen, showed the refusal and then charged the full cost anyway — a non-Sverm trying the Brood Mound got "Only the Sverm can raise a hive." and lost 40 wood and 20 resin. The refusal stopped the building, but Valheim takes the cost in a separate step that never heard about it. Now a refused building costs nothing, no stamina included. This covered every locked building in the mod: the Sverm hive and market (and the one-hive-per-area limit), the Skadi golem, the Dvergar contract bank and barrel, the Trenta Elder Root and the Trol totem. Thanks to the tester who noticed the wood going missing.
|
- **Fix - A refused race building still took your materials:** building something your race is not allowed to build, or before its boss has fallen, showed the refusal and then charged the full cost anyway — a non-Sverm trying the Brood Mound got "Only the Sverm can raise a hive." and lost 40 wood and 20 resin. The refusal stopped the building, but Valheim takes the cost in a separate step that never heard about it. Now a refused building costs nothing, no stamina included. This covered every locked building in the mod: the Sverm hive and market (and the one-hive-per-area limit), the Skadi golem, the Dvergar contract bank and barrel, the Trenta Elder Root and the Trol totem. Thanks to the tester who noticed the wood going missing.
|
||||||
- **Fix - On a gamepad the Skadi cast the Cold Spell every time she built:** the spell sits on the pad's secondary attack button, which Valheim also uses to remove pieces (Classic layout) or place them (Alt 2). Every piece built or removed also cast the spell and drained stamina, which made building nearly impossible. The spell no longer casts while you hold the hammer, hoe or cultivator — on the keyboard as well, where middle mouse is Remove.
|
- **Fix - On a gamepad the Skadi cast the Cold Spell every time she built:** the spell sits on the pad's secondary attack button, which Valheim also uses to remove pieces (Classic layout) or place them (Alt 2). Every piece built or removed also cast the spell and drained stamina, which made building nearly impossible. The spell no longer casts while you hold the hammer, hoe or cultivator — on the keyboard as well, where middle mouse is Remove.
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "RacesOfValheim",
|
"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.",
|
"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.4.20",
|
"version_number": "1.4.21",
|
||||||
"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