Merge branch 'localisation' into localisation-russian
This commit is contained in:
commit
a07948f663
20 changed files with 281 additions and 64 deletions
|
|
@ -119,7 +119,10 @@ namespace RacesOfValheim
|
||||||
if (Time.time >= nextPulse)
|
if (Time.time >= nextPulse)
|
||||||
{
|
{
|
||||||
nextPulse = Time.time + AlfarPowerConfig.ArchonPulseInterval.Value;
|
nextPulse = Time.time + AlfarPowerConfig.ArchonPulseInterval.Value;
|
||||||
AlfarPowers.Pulse(player, AlfarPowerConfig.ArchonPulseRadius.Value, AlfarPowerConfig.ArchonPulseDamage.Value);
|
// The pulse fires on its own while the form lasts, so it earns what an aura does:
|
||||||
|
// a tenth of a hit per second, once per pulse that struck something.
|
||||||
|
if (AlfarPowers.Pulse(player, AlfarPowerConfig.ArchonPulseRadius.Value, AlfarPowerConfig.ArchonPulseDamage.Value))
|
||||||
|
FormMelee.RaiseSkill(Skills.SkillType.ElementalMagic, 0.1f * AlfarPowerConfig.ArchonPulseInterval.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,12 +148,17 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>A pulse of lightning on every hostile creature within a radius of the Alfr.</summary>
|
/// <summary>A pulse of lightning on every hostile creature within a radius of the Alfr.</summary>
|
||||||
public static void Pulse(Player player, float radius, float damage)
|
/// <returns>True if it struck at least one creature.</returns>
|
||||||
|
public static bool Pulse(Player player, float radius, float damage)
|
||||||
{
|
{
|
||||||
|
bool struck = false;
|
||||||
foreach (Character character in CharactersIn(player.transform.position, radius))
|
foreach (Character character in CharactersIn(player.transform.position, radius))
|
||||||
{
|
{
|
||||||
if (IsHostile(player, character)) Strike(player, character, damage, character.GetCenterPoint());
|
if (!IsHostile(player, character)) continue;
|
||||||
|
Strike(player, character, damage, character.GetCenterPoint());
|
||||||
|
struck = true;
|
||||||
}
|
}
|
||||||
|
return struck;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IEnumerable<Character> CharactersIn(Vector3 center, float radius)
|
private static IEnumerable<Character> CharactersIn(Vector3 center, float radius)
|
||||||
|
|
@ -396,7 +401,11 @@ namespace RacesOfValheim
|
||||||
AlfarEitr.Spend(player, cost);
|
AlfarEitr.Spend(player, cost);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsHostile(player, target)) Strike(player, target, AlfarPowerConfig.BeamDps.Value * tick, end);
|
if (IsHostile(player, target))
|
||||||
|
{
|
||||||
|
Strike(player, target, AlfarPowerConfig.BeamDps.Value * tick, end);
|
||||||
|
FormMelee.RaiseSkill(Skills.SkillType.ElementalMagic, tick); // a full hit per second on target
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void RaiseHand(Player player)
|
private static void RaiseHand(Player player)
|
||||||
|
|
@ -548,14 +557,19 @@ namespace RacesOfValheim
|
||||||
const float tick = 0.5f;
|
const float tick = 0.5f;
|
||||||
nextTick = Time.time + tick;
|
nextTick = Time.time + tick;
|
||||||
|
|
||||||
|
bool struck = false;
|
||||||
foreach (Collider collider in Physics.OverlapSphere(transform.position, Radius, ~0, QueryTriggerInteraction.Ignore))
|
foreach (Collider collider in Physics.OverlapSphere(transform.position, Radius, ~0, QueryTriggerInteraction.Ignore))
|
||||||
{
|
{
|
||||||
Character character = collider.GetComponentInParent<Character>();
|
Character character = collider.GetComponentInParent<Character>();
|
||||||
if (character == null || character == Owner || character.IsDead() || character.IsTamed()) continue;
|
if (character == null || character == Owner || character.IsDead() || character.IsTamed()) continue;
|
||||||
if (!BaseAI.IsEnemy(Owner, character)) continue;
|
if (!BaseAI.IsEnemy(Owner, character)) continue;
|
||||||
AlfarPowers.Strike(Owner, character, DamagePerSecond * tick, character.GetCenterPoint());
|
AlfarPowers.Strike(Owner, character, DamagePerSecond * tick, character.GetCenterPoint());
|
||||||
|
struck = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Once per tick, not per creature: a full hit per second the storm strikes something.
|
||||||
|
if (struck && Owner == Player.m_localPlayer) FormMelee.RaiseSkill(Skills.SkillType.ElementalMagic, tick);
|
||||||
|
|
||||||
Vector2 offset = Random.insideUnitCircle * Radius;
|
Vector2 offset = Random.insideUnitCircle * Radius;
|
||||||
AlfarFx.Spawn("fx_JotunWitch_LightningBolt_Explosion", transform.position + new Vector3(offset.x, 0f, offset.y));
|
AlfarFx.Spawn("fx_JotunWitch_LightningBolt_Explosion", transform.position + new Vector3(offset.x, 0f, offset.y));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -931,6 +931,30 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Pukeberries empty the fourth stomach too.
|
||||||
|
///
|
||||||
|
/// SE_Puke calls RemoveOneFood once a second, and vanilla only ever picks from its own three
|
||||||
|
/// slots, so the Aswid's fourth meal survived the berries. It now goes into the same random
|
||||||
|
/// draw as the other three, the way the Trol's extra slots do.
|
||||||
|
/// </summary>
|
||||||
|
[HarmonyPatch(typeof(Player), "RemoveOneFood")]
|
||||||
|
public static class Aswid_PlayerRemoveOneFood_Patch
|
||||||
|
{
|
||||||
|
public static bool Prefix(Player __instance, System.Collections.Generic.List<Player.Food> ___m_foods, ref bool __result)
|
||||||
|
{
|
||||||
|
if (__instance != Player.m_localPlayer || !AswidRace.IsAswid()) return true;
|
||||||
|
if (!AswidFoodManager.ExtraFoods.TryGetValue(__instance, out Player.Food extraFood) || extraFood == null) return true;
|
||||||
|
|
||||||
|
int vanillaCount = ___m_foods != null ? ___m_foods.Count : 0;
|
||||||
|
if (Random.Range(0, vanillaCount + 1) < vanillaCount) return true; // one of vanilla's three
|
||||||
|
|
||||||
|
AswidFoodManager.ClearFood(__instance);
|
||||||
|
__result = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(Player), "ClearFood")]
|
[HarmonyPatch(typeof(Player), "ClearFood")]
|
||||||
public static class Aswid_Player_ClearFood_Patch
|
public static class Aswid_Player_ClearFood_Patch
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1191,6 +1191,7 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
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);
|
||||||
|
bool hitCreature = false;
|
||||||
|
|
||||||
foreach (var col in colliders)
|
foreach (var col in colliders)
|
||||||
{
|
{
|
||||||
|
|
@ -1241,10 +1242,16 @@ namespace RacesOfValheim
|
||||||
// kill). ApplyDamage() skipped all of that: it edited the local copy of a
|
// kill). ApplyDamage() skipped all of that: it edited the local copy of a
|
||||||
// character we usually do not own, and the owner overwrote it on the next sync.
|
// character we usually do not own, and the owner overwrote it on the next sync.
|
||||||
c.Damage(hd);
|
c.Damage(hd);
|
||||||
|
hitCreature = true;
|
||||||
|
|
||||||
SpawnBloodVFX(c);
|
SpawnBloodVFX(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The aura scales with Blood Magic but called Damage directly, so it never paid
|
||||||
|
// the skill back. Passive and always on, so it earns what the Skadi's Frost Aura
|
||||||
|
// does: a tenth of a hit per second of draining, once per tick, not per victim.
|
||||||
|
if (hitCreature) FormMelee.RaiseSkill(Skills.SkillType.BloodMagic, 0.1f * AswidConfig.AuraTickInterval.Value);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,10 @@ namespace RacesOfValheim
|
||||||
if (!__result) return; // already not enemies, nothing to add
|
if (!__result) return; // already not enemies, nothing to add
|
||||||
if (a == null || b == null) return;
|
if (a == null || b == null) return;
|
||||||
|
|
||||||
|
// The player's own blow. Peace is the creature's choice, not a shield. See
|
||||||
|
// RaceGrudge.StrikeScope.
|
||||||
|
if (RaceGrudge.PlayerStrikes(a)) return;
|
||||||
|
|
||||||
if (IsThrallTruce(a, b) || IsThrallTruce(b, a))
|
if (IsThrallTruce(a, b) || IsThrallTruce(b, a))
|
||||||
{
|
{
|
||||||
__result = false;
|
__result = false;
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,9 @@ namespace RacesOfValheim
|
||||||
"Without this the truce is absolute in both directions: MonsterAI.UpdateTarget " +
|
"Without this the truce is absolute in both directions: MonsterAI.UpdateTarget " +
|
||||||
"throws away any target BaseAI.IsEnemy calls a non-enemy, so a truced mob could " +
|
"throws away any target BaseAI.IsEnemy calls a non-enemy, so a truced mob could " +
|
||||||
"not fight back even after being struck - it stood still, or fled because it " +
|
"not fight back even after being struck - it stood still, or fled because it " +
|
||||||
"was hurt and had no enemy it was allowed to have. The grudge is per attacker " +
|
"was hurt and had no enemy it was allowed to have. Each creature holds one " +
|
||||||
"and per creature, on whichever machine runs that creature's AI. 0 restores the " +
|
"grudge, against the last player who hit it, and keeps it when another player's " +
|
||||||
|
"game takes over running that creature. 0 restores the " +
|
||||||
"old absolute truce.",
|
"old absolute truce.",
|
||||||
new AcceptableValueRange<float>(0f, 600f)));
|
new AcceptableValueRange<float>(0f, 600f)));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -774,6 +774,7 @@ namespace RacesOfValheim
|
||||||
Collider[] hits = Physics.OverlapSphere(attackPoint, attackRadius, layerMask);
|
Collider[] hits = Physics.OverlapSphere(attackPoint, attackRadius, layerMask);
|
||||||
FormMelee.LogSwing(FormLabel, hits.Length);
|
FormMelee.LogSwing(FormLabel, hits.Length);
|
||||||
System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>();
|
System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>();
|
||||||
|
bool hitCreature = false;
|
||||||
|
|
||||||
foreach (Collider hit in hits)
|
foreach (Collider hit in hits)
|
||||||
{
|
{
|
||||||
|
|
@ -823,10 +824,13 @@ namespace RacesOfValheim
|
||||||
FormMelee.LogHit(FormLabel, target, totalDamage);
|
FormMelee.LogHit(FormLabel, target, totalDamage);
|
||||||
target.Damage(hitData);
|
target.Damage(hitData);
|
||||||
FormMelee.GrantAdrenaline(target);
|
FormMelee.GrantAdrenaline(target);
|
||||||
|
if (target is Character) hitCreature = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hitCreature) FormMelee.RaiseSkill(Skills.SkillType.Unarmed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1067,6 +1071,7 @@ namespace RacesOfValheim
|
||||||
Collider[] hits = Physics.OverlapSphere(attackPoint, attackRadius, layerMask);
|
Collider[] hits = Physics.OverlapSphere(attackPoint, attackRadius, layerMask);
|
||||||
FormMelee.LogSwing(FormLabel, hits.Length);
|
FormMelee.LogSwing(FormLabel, hits.Length);
|
||||||
System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>();
|
System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>();
|
||||||
|
bool hitCreature = false;
|
||||||
|
|
||||||
foreach (Collider hit in hits)
|
foreach (Collider hit in hits)
|
||||||
{
|
{
|
||||||
|
|
@ -1106,6 +1111,7 @@ namespace RacesOfValheim
|
||||||
FormMelee.LogHit(FormLabel, target, totalDamage);
|
FormMelee.LogHit(FormLabel, target, totalDamage);
|
||||||
target.Damage(hitData);
|
target.Damage(hitData);
|
||||||
FormMelee.GrantAdrenaline(target, 0.2f); // one 0.2s tick: a full hit per second of breath
|
FormMelee.GrantAdrenaline(target, 0.2f); // one 0.2s tick: a full hit per second of breath
|
||||||
|
if (target is Character) hitCreature = true;
|
||||||
|
|
||||||
if (ZNetScene.instance != null)
|
if (ZNetScene.instance != null)
|
||||||
{
|
{
|
||||||
|
|
@ -1115,6 +1121,8 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hitCreature) FormMelee.RaiseSkill(Skills.SkillType.ElementalMagic, 0.2f); // one 0.2s tick: a full swing's worth per second of breath
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator ClawRoutine()
|
private IEnumerator ClawRoutine()
|
||||||
|
|
@ -1231,6 +1239,7 @@ namespace RacesOfValheim
|
||||||
Collider[] hits = Physics.OverlapSphere(attackPoint, attackRadius, layerMask);
|
Collider[] hits = Physics.OverlapSphere(attackPoint, attackRadius, layerMask);
|
||||||
FormMelee.LogSwing(FormLabel, hits.Length);
|
FormMelee.LogSwing(FormLabel, hits.Length);
|
||||||
System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>();
|
System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>();
|
||||||
|
bool hitCreature = false;
|
||||||
|
|
||||||
foreach (Collider hit in hits)
|
foreach (Collider hit in hits)
|
||||||
{
|
{
|
||||||
|
|
@ -1280,10 +1289,13 @@ namespace RacesOfValheim
|
||||||
FormMelee.LogHit(FormLabel, target, totalDamage);
|
FormMelee.LogHit(FormLabel, target, totalDamage);
|
||||||
target.Damage(hitData);
|
target.Damage(hitData);
|
||||||
FormMelee.GrantAdrenaline(target);
|
FormMelee.GrantAdrenaline(target);
|
||||||
|
if (target is Character) hitCreature = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hitCreature) FormMelee.RaiseSkill(Skills.SkillType.Unarmed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1446,6 +1458,7 @@ namespace RacesOfValheim
|
||||||
Collider[] hits = Physics.OverlapSphere(attackPoint, attackRadius, layerMask);
|
Collider[] hits = Physics.OverlapSphere(attackPoint, attackRadius, layerMask);
|
||||||
FormMelee.LogSwing(FormLabel, hits.Length);
|
FormMelee.LogSwing(FormLabel, hits.Length);
|
||||||
System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>();
|
System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>();
|
||||||
|
bool hitCreature = false;
|
||||||
|
|
||||||
foreach (Collider hit in hits)
|
foreach (Collider hit in hits)
|
||||||
{
|
{
|
||||||
|
|
@ -1495,10 +1508,13 @@ namespace RacesOfValheim
|
||||||
FormMelee.LogHit(FormLabel, target, totalDamage);
|
FormMelee.LogHit(FormLabel, target, totalDamage);
|
||||||
target.Damage(hitData);
|
target.Damage(hitData);
|
||||||
FormMelee.GrantAdrenaline(target);
|
FormMelee.GrantAdrenaline(target);
|
||||||
|
if (target is Character) hitCreature = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hitCreature) FormMelee.RaiseSkill(Skills.SkillType.Unarmed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1654,6 +1670,7 @@ namespace RacesOfValheim
|
||||||
Collider[] hits = Physics.OverlapSphere(attackPoint, attackRadius, layerMask);
|
Collider[] hits = Physics.OverlapSphere(attackPoint, attackRadius, layerMask);
|
||||||
FormMelee.LogSwing(FormLabel, hits.Length);
|
FormMelee.LogSwing(FormLabel, hits.Length);
|
||||||
System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>();
|
System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>();
|
||||||
|
bool hitCreature = false;
|
||||||
|
|
||||||
foreach (Collider hit in hits)
|
foreach (Collider hit in hits)
|
||||||
{
|
{
|
||||||
|
|
@ -1703,10 +1720,13 @@ namespace RacesOfValheim
|
||||||
FormMelee.LogHit(FormLabel, target, totalDamage);
|
FormMelee.LogHit(FormLabel, target, totalDamage);
|
||||||
target.Damage(hitData);
|
target.Damage(hitData);
|
||||||
FormMelee.GrantAdrenaline(target);
|
FormMelee.GrantAdrenaline(target);
|
||||||
|
if (target is Character) hitCreature = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hitCreature) FormMelee.RaiseSkill(Skills.SkillType.Unarmed);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator UlvJumpAttackRoutine()
|
private IEnumerator UlvJumpAttackRoutine()
|
||||||
|
|
|
||||||
|
|
@ -368,6 +368,21 @@ namespace RacesOfValheim
|
||||||
player.AddAdrenaline(perHit * character.m_enemyAdrenalineMultiplier * scale);
|
player.AddAdrenaline(perHit * character.m_enemyAdrenalineMultiplier * scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The skill experience vanilla gives for a weapon hit, which a hand-built hit never got.
|
||||||
|
/// Vanilla raises the skill inside Attack (once per swing that landed on a creature) and
|
||||||
|
/// inside Projectile.OnHit; Character.Damage never does, so a form that calls Damage
|
||||||
|
/// directly left its skill at whatever level the player brought in. Call it once per
|
||||||
|
/// swing or tick, after the loop, never once per target. amount lets a damage-over-time
|
||||||
|
/// tick pay a fraction of a swing.
|
||||||
|
/// </summary>
|
||||||
|
public static void RaiseSkill(Skills.SkillType skill, float amount = 1f)
|
||||||
|
{
|
||||||
|
Player player = Player.m_localPlayer;
|
||||||
|
if (player == null || amount <= 0f) return;
|
||||||
|
player.RaiseSkill(skill, amount);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Charges a form attack's stamina the way vanilla charges a weapon's (Attack.GetAttackStamina):
|
/// Charges a form attack's stamina the way vanilla charges a weapon's (Attack.GetAttackStamina):
|
||||||
/// the equipment modifier, status effects (meads, race passives), then up to a third off with
|
/// the equipment modifier, status effects (meads, race passives), then up to a third off with
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "RacesOfValheim",
|
"name": "RacesOfValheim",
|
||||||
"description": "A Valheim mod that adds eleven custom playable races (Alfar, 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 eleven custom playable races (Alfar, 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.6.8",
|
"version_number": "1.6.9",
|
||||||
"website_url": "",
|
"website_url": "",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"denikson-BepInExPack_Valheim-5.4.2333",
|
"denikson-BepInExPack_Valheim-5.4.2333",
|
||||||
|
|
|
||||||
|
|
@ -874,8 +874,8 @@ namespace RacesOfValheim
|
||||||
int foodDuration = Mathf.RoundToInt(TrentaConfig.FoodDurationMultiplier);
|
int foodDuration = Mathf.RoundToInt(TrentaConfig.FoodDurationMultiplier);
|
||||||
|
|
||||||
int purpleRainRadius = Mathf.RoundToInt(TrentaConfig.PurpleRainRadius);
|
int purpleRainRadius = Mathf.RoundToInt(TrentaConfig.PurpleRainRadius);
|
||||||
int purpleRainHeal = Mathf.RoundToInt(TrentaConfig.PurpleRainHealAmount);
|
int purpleRainHeal = Mathf.RoundToInt(TrentaConfig.PurpleRainHealFor(Player.m_localPlayer));
|
||||||
int purpleRainPoison = Mathf.RoundToInt(TrentaConfig.PurpleRainPoisonDamage);
|
int purpleRainPoison = Mathf.RoundToInt(TrentaConfig.PurpleRainPoisonFor(Player.m_localPlayer));
|
||||||
int purpleRainCooldown = Mathf.RoundToInt(TrentaConfigManagement.PurpleRainCooldown.Value);
|
int purpleRainCooldown = Mathf.RoundToInt(TrentaConfigManagement.PurpleRainCooldown.Value);
|
||||||
int purpleRainMuspellCooldown = Mathf.RoundToInt(TrentaConfigManagement.MuspellPurpleRainCooldown.Value);
|
int purpleRainMuspellCooldown = Mathf.RoundToInt(TrentaConfigManagement.MuspellPurpleRainCooldown.Value);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,13 @@ namespace RacesOfValheim
|
||||||
/// which means everything downstream - acquiring, chasing, retaliating, giving up - is vanilla
|
/// which means everything downstream - acquiring, chasing, retaliating, giving up - is vanilla
|
||||||
/// behaviour rather than anything reimplemented here.
|
/// behaviour rather than anything reimplemented here.
|
||||||
///
|
///
|
||||||
/// WHERE IT RUNS. On the client that owns the mob's AI, which is the only one whose UpdateTarget
|
/// WHERE IT LIVES. On the creature's own ZDO: who it is angry at and until when, in network time.
|
||||||
/// matters and the only one that runs Character.ApplyDamage for it. BaseAI.OnDamaged is reached
|
/// The AI that reads it runs on whichever machine owns the creature, and that can change in the
|
||||||
/// through the character's damage callback on exactly that machine, so the record is made where
|
/// middle of a fight (the owner walks off or logs out). A grudge kept in one machine's memory
|
||||||
/// it will be read. Nothing is replicated and nothing needs to be: another client's copy of the
|
/// went with it, and the new owner's copy of the creature made peace on its next UpdateTarget.
|
||||||
/// same mob is not the one deciding who it chases.
|
/// On the ZDO the new owner reads the same grudge. Only the owner writes it: a hit reaches the
|
||||||
|
/// owner through Character.Damage's RPC anyway, and kin owned elsewhere are told by an RPC of
|
||||||
|
/// our own (RpcName), so no client writes a ZDO it does not own.
|
||||||
///
|
///
|
||||||
/// Vanilla has its own version of this idea in BaseAI.SetAggravated, and it is not usable here:
|
/// Vanilla has its own version of this idea in BaseAI.SetAggravated, and it is not usable here:
|
||||||
/// it does nothing unless the prefab sets m_aggravatable, which only the dvergr and the seekers
|
/// it does nothing unless the prefab sets m_aggravatable, which only the dvergr and the seekers
|
||||||
|
|
@ -37,67 +39,96 @@ namespace RacesOfValheim
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class RaceGrudge
|
public static class RaceGrudge
|
||||||
{
|
{
|
||||||
private struct Grudge
|
private const string RpcName = "RacesOfValheim_Grudge";
|
||||||
{
|
|
||||||
public ZDOID Attacker;
|
|
||||||
public float Until;
|
|
||||||
}
|
|
||||||
|
|
||||||
// One grudge per mob, against the last thing that hit it. A creature can only chase one
|
// One grudge per creature, against the last player that hit it. A creature can only chase
|
||||||
// target anyway, and if two players of the same race are both poking it, the one it wants
|
// one target anyway, and if two players of the same race are both poking it, the one it
|
||||||
// is whoever hit it last.
|
// wants is whoever hit it last.
|
||||||
private static readonly Dictionary<ZDOID, Grudge> grudges = new Dictionary<ZDOID, Grudge>();
|
private static readonly KeyValuePair<int, int> AttackerKey = ZDO.GetHashZDOID("RacesOfValheim_GrudgeAttacker");
|
||||||
private static float lastSweep = 0f;
|
private static readonly int UntilKey = "RacesOfValheim_GrudgeUntil".GetStableHashCode();
|
||||||
|
|
||||||
private static float Duration => FactionsConfig.GrudgeSeconds;
|
private static float Duration => FactionsConfig.GrudgeSeconds;
|
||||||
|
|
||||||
|
// Network time, the same on every machine, so an end time written by one owner means the
|
||||||
|
// same thing to the next. Milliseconds in a long: ZDO has no double.
|
||||||
|
private static long NowMs => ZNet.instance != null ? (long)(ZNet.instance.GetTimeSeconds() * 1000.0) : 0L;
|
||||||
|
|
||||||
|
private static ZDO ZdoOf(Character character)
|
||||||
|
{
|
||||||
|
if (character == null || ZDOMan.instance == null) return null;
|
||||||
|
ZDOID id = character.GetZDOID();
|
||||||
|
return id.IsNone() ? null : ZDOMan.instance.GetZDO(id);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// True while <paramref name="monster"/> is owed a hit by <paramref name="player"/>. Both
|
/// True while <paramref name="monster"/> is owed a hit by <paramref name="player"/>. Both
|
||||||
/// truce postfixes ask this first and leave IsEnemy alone when it answers yes.
|
/// truce postfixes ask this first and leave IsEnemy alone when it answers yes. Read on any
|
||||||
|
/// machine; it only matters on the owner's.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool Holds(Character monster, Character player)
|
public static bool Holds(Character monster, Character player)
|
||||||
{
|
{
|
||||||
if (monster == null || player == null) return false;
|
if (monster == null || player == null) return false;
|
||||||
if (Duration <= 0f) return false;
|
if (Duration <= 0f) return false;
|
||||||
|
|
||||||
if (!grudges.TryGetValue(monster.GetZDOID(), out Grudge grudge)) return false;
|
ZDO zdo = ZdoOf(monster);
|
||||||
if (Time.time >= grudge.Until) return false;
|
if (zdo == null) return false;
|
||||||
|
|
||||||
return grudge.Attacker == player.GetZDOID();
|
long until = zdo.GetLong(UntilKey, 0L);
|
||||||
}
|
if (until == 0L || NowMs >= until) return false;
|
||||||
|
|
||||||
public static void Remember(Character monster, Character attacker)
|
return zdo.GetZDOID(AttackerKey) == player.GetZDOID();
|
||||||
{
|
|
||||||
if (monster == null || attacker == null) return;
|
|
||||||
if (Duration <= 0f) return;
|
|
||||||
|
|
||||||
grudges[monster.GetZDOID()] = new Grudge
|
|
||||||
{
|
|
||||||
Attacker = attacker.GetZDOID(),
|
|
||||||
Until = Time.time + Duration
|
|
||||||
};
|
|
||||||
|
|
||||||
Sweep();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Drops grudges nobody is owed any more. At most once per duration: a fight is a burst of
|
/// Writes the grudge on the creature's ZDO if this machine owns it, and otherwise asks the
|
||||||
/// damage events and the list should not be walked on each one.
|
/// owner to. Returns true when it was written here.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static void Sweep()
|
public static bool Remember(Character monster, Character attacker)
|
||||||
{
|
{
|
||||||
if (Time.time - lastSweep < Duration) return;
|
if (monster == null || attacker == null) return false;
|
||||||
lastSweep = Time.time;
|
if (Duration <= 0f) return false;
|
||||||
|
|
||||||
List<ZDOID> expired = null;
|
ZNetView nview = monster.GetComponent<ZNetView>();
|
||||||
foreach (var entry in grudges)
|
if (nview == null || !nview.IsValid()) return false;
|
||||||
|
|
||||||
|
if (!nview.IsOwner())
|
||||||
{
|
{
|
||||||
if (Time.time < entry.Value.Until) continue;
|
nview.InvokeRPC(RpcName, attacker.GetZDOID());
|
||||||
if (expired == null) expired = new List<ZDOID>();
|
return false;
|
||||||
expired.Add(entry.Key);
|
}
|
||||||
|
|
||||||
|
Write(nview.GetZDO(), attacker.GetZDOID());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void Write(ZDO zdo, ZDOID attacker)
|
||||||
|
{
|
||||||
|
zdo.Set(AttackerKey, attacker);
|
||||||
|
zdo.Set(UntilKey, NowMs + (long)(Duration * 1000f));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Every creature can be told about a grudge by a machine that does not own it. ZNetView's
|
||||||
|
/// InvokeRPC routes to the owner, so the handler always runs where the ZDO may be written,
|
||||||
|
/// and the owner checks it is still the owner: ownership can move while the RPC travels.
|
||||||
|
/// </summary>
|
||||||
|
[HarmonyPatch(typeof(Character), "Awake")]
|
||||||
|
public static class Character_Awake_GrudgeRpc_Patch
|
||||||
|
{
|
||||||
|
public static void Postfix(Character __instance)
|
||||||
|
{
|
||||||
|
if (__instance.IsPlayer()) return;
|
||||||
|
ZNetView nview = __instance.GetComponent<ZNetView>();
|
||||||
|
if (nview == null || !nview.IsValid()) return;
|
||||||
|
|
||||||
|
nview.Register<ZDOID>(RpcName, (sender, attacker) =>
|
||||||
|
{
|
||||||
|
if (__instance == null || !nview.IsValid() || !nview.IsOwner()) return;
|
||||||
|
if (attacker.IsNone() || Duration <= 0f) return;
|
||||||
|
Write(nview.GetZDO(), attacker);
|
||||||
|
__instance.GetBaseAI()?.Alert();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (expired == null) return;
|
|
||||||
foreach (ZDOID id in expired) grudges.Remove(id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -125,14 +156,62 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// How deep we are inside one of vanilla's hit filters (see StrikeScope). A counter rather
|
||||||
|
// than a bool because Projectile.OnHit calls DoAOE, and the inner exit must not end the
|
||||||
|
// outer scope.
|
||||||
|
private static int strikeDepth = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// True while vanilla is deciding whether <paramref name="attacker"/>'s own weapon, arrow or
|
||||||
|
/// area hit lands. Both truce postfixes stand down for that question: the truce is about
|
||||||
|
/// who a creature attacks, never about whether the player is allowed to strike it.
|
||||||
|
/// </summary>
|
||||||
|
public static bool PlayerStrikes(Character attacker)
|
||||||
|
{
|
||||||
|
return strikeDepth > 0 && attacker != null && attacker.IsPlayer();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// THE PLAYER COULD NOT HIT THEIR OWN FACTION AT ALL. Valheim 1.0's hit filters (Attack's
|
||||||
|
/// melee and area swings, Projectile's direct hit, its AoE and its IsValidTarget, Aoe's
|
||||||
|
/// ShouldHit) ask BaseAI.IsEnemy(attacker, target) and skip the target when it answers false
|
||||||
|
/// and the attacker is a player without PvP on - vanilla's guard for tames. Our truce
|
||||||
|
/// answers false for every allied creature, so the blow passed through it, it took no
|
||||||
|
/// damage, BaseAI.OnDamaged never ran and no grudge was ever born. That is both reports at
|
||||||
|
/// once: "it will not allow me" to attack, and kin that never fight back, group grudge on or
|
||||||
|
/// off, because nobody was ever hit. With PvP on the filter let the hit through, which is
|
||||||
|
/// why it looked fine in some tests.
|
||||||
|
///
|
||||||
|
/// The scope is open only around those six methods, so everything else that asks IsEnemy
|
||||||
|
/// with the player first keeps the truce: the green health bar on allied creatures, sneaking
|
||||||
|
/// past them, the Aswid's aura leaving kin alone.
|
||||||
|
/// </summary>
|
||||||
|
[HarmonyPatch]
|
||||||
|
public static class StrikeScope
|
||||||
|
{
|
||||||
|
public static IEnumerable<System.Reflection.MethodBase> TargetMethods()
|
||||||
|
{
|
||||||
|
yield return AccessTools.Method(typeof(Attack), "DoMeleeAttack");
|
||||||
|
yield return AccessTools.Method(typeof(Attack), "DoAreaAttack");
|
||||||
|
yield return AccessTools.Method(typeof(Projectile), "DoAOE");
|
||||||
|
yield return AccessTools.Method(typeof(Projectile), "IsValidTarget");
|
||||||
|
yield return AccessTools.Method(typeof(Projectile), "OnHit");
|
||||||
|
yield return AccessTools.Method(typeof(Aoe), "ShouldHit");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Prefix() => strikeDepth++;
|
||||||
|
|
||||||
|
// Finalizer rather than Postfix: the count has to come down even when the method
|
||||||
|
// throws, or every IsEnemy afterwards would ignore the truce.
|
||||||
|
public static void Finalizer() => strikeDepth--;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Vanilla's Dvergr camp, for every faction ("Grudge spreads to kin", off by default): hit
|
/// Vanilla's Dvergr camp, for every faction ("Grudge spreads to kin", off by default): hit
|
||||||
/// a creature that is at peace with you and its kin around it take up the same grudge.
|
/// a creature that is at peace with you and its kin around it take up the same grudge.
|
||||||
///
|
///
|
||||||
/// Only the creatures this machine runs the AI for are told, because a grudge is read where
|
/// Kin this machine owns are written here; kin owned by another player's machine are told
|
||||||
/// the AI runs (see WHERE IT RUNS above). The creatures around the one that was hit are
|
/// through RpcName, and their owner writes the grudge and alerts them.
|
||||||
/// nearly always simulated by the same client; one owned by another player's machine stays
|
|
||||||
/// at peace until it is hit itself.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static void SpreadToKin(Character monster, Player player)
|
private static void SpreadToKin(Character monster, Player player)
|
||||||
{
|
{
|
||||||
|
|
@ -144,12 +223,10 @@ namespace RacesOfValheim
|
||||||
foreach (Character other in Character.GetAllCharacters())
|
foreach (Character other in Character.GetAllCharacters())
|
||||||
{
|
{
|
||||||
if (other == null || other == monster || other.IsPlayer() || other.IsDead() || other.IsTamed()) continue;
|
if (other == null || other == monster || other.IsPlayer() || other.IsDead() || other.IsTamed()) continue;
|
||||||
if (!other.IsOwner()) continue;
|
|
||||||
if (Vector3.Distance(other.transform.position, center) > radius) continue;
|
if (Vector3.Distance(other.transform.position, center) > radius) continue;
|
||||||
if (!FactionHostilityPatch.IsAlliedMob(race, other.gameObject.name)) continue;
|
if (!FactionHostilityPatch.IsAlliedMob(race, other.gameObject.name)) continue;
|
||||||
|
|
||||||
Remember(other, player);
|
if (Remember(other, player)) other.GetBaseAI()?.Alert();
|
||||||
other.GetBaseAI()?.Alert();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
if (a == null || b == null) return;
|
if (a == null || b == null) return;
|
||||||
|
|
||||||
|
// The player's own blow lands on kin too. See RaceGrudge.StrikeScope.
|
||||||
|
if (RaceGrudge.PlayerStrikes(a)) return;
|
||||||
|
|
||||||
Character playerCharacter = a.IsPlayer() ? a : (b.IsPlayer() ? b : null);
|
Character playerCharacter = a.IsPlayer() ? a : (b.IsPlayer() ? b : null);
|
||||||
Character monster = a.IsPlayer() ? b : (b.IsPlayer() ? a : null);
|
Character monster = a.IsPlayer() ? b : (b.IsPlayer() ? a : null);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,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.6.8";
|
public const string PluginVersion = "1.6.9";
|
||||||
|
|
||||||
private readonly Harmony harmony = new Harmony(PluginGUID);
|
private readonly Harmony harmony = new Harmony(PluginGUID);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -599,6 +599,7 @@ namespace RacesOfValheim
|
||||||
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, radius, layerMask);
|
Collider[] hits = Physics.OverlapSphere(attackPoint, radius, layerMask);
|
||||||
System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>();
|
System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>();
|
||||||
|
bool hitCreature = false;
|
||||||
|
|
||||||
foreach (Collider hit in hits)
|
foreach (Collider hit in hits)
|
||||||
{
|
{
|
||||||
|
|
@ -641,7 +642,10 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
target.Damage(hitData);
|
target.Damage(hitData);
|
||||||
FormMelee.GrantAdrenaline(target);
|
FormMelee.GrantAdrenaline(target);
|
||||||
|
if (characterTarget != null) hitCreature = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hitCreature) FormMelee.RaiseSkill(Skills.SkillType.Unarmed);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDestroy()
|
private void OnDestroy()
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,14 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
// The Trenta stands in its own rain and is healed by it too. It used to be left out, so
|
// The Trenta stands in its own rain and is healed by it too. It used to be left out, so
|
||||||
// a lone Trenta cast a heal that never touched anyone.
|
// a lone Trenta cast a heal that never touched anyone.
|
||||||
player.Heal(TrentaConfig.PurpleRainHealAmount, true);
|
float heal = TrentaConfig.PurpleRainHealFor(player);
|
||||||
|
float poison = TrentaConfig.PurpleRainPoisonFor(player);
|
||||||
|
player.Heal(heal, true);
|
||||||
|
|
||||||
|
// Blood Magic experience once per cast that reached someone besides the caster, the
|
||||||
|
// way a vanilla staff pays per cast: healing only yourself earns nothing, or the
|
||||||
|
// skill would level by casting into an empty field on cooldown.
|
||||||
|
bool reachedSomeone = false;
|
||||||
|
|
||||||
HashSet<Character> hit = new HashSet<Character>();
|
HashSet<Character> hit = new HashSet<Character>();
|
||||||
foreach (Collider collider in Physics.OverlapSphere(player.transform.position, TrentaConfig.PurpleRainRadius))
|
foreach (Collider collider in Physics.OverlapSphere(player.transform.position, TrentaConfig.PurpleRainRadius))
|
||||||
|
|
@ -209,16 +216,20 @@ namespace RacesOfValheim
|
||||||
if (BaseAI.IsEnemy(player, character))
|
if (BaseAI.IsEnemy(player, character))
|
||||||
{
|
{
|
||||||
HitData hitData = new HitData();
|
HitData hitData = new HitData();
|
||||||
hitData.m_damage.m_poison = TrentaConfig.PurpleRainPoisonDamage;
|
hitData.m_damage.m_poison = poison;
|
||||||
|
hitData.m_skill = Skills.SkillType.BloodMagic;
|
||||||
hitData.SetAttacker(player);
|
hitData.SetAttacker(player);
|
||||||
hitData.m_dir = Vector3.zero;
|
hitData.m_dir = Vector3.zero;
|
||||||
character.Damage(hitData);
|
character.Damage(hitData);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
character.Heal(TrentaConfig.PurpleRainHealAmount, true);
|
character.Heal(heal, true);
|
||||||
}
|
}
|
||||||
|
reachedSomeone = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (reachedSomeone) FormMelee.RaiseSkill(Skills.SkillType.BloodMagic);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,16 @@ namespace RacesOfValheim
|
||||||
public static float PurpleRainRadius => TrentaConfigManagement.PurpleRainRadius.Value;
|
public static float PurpleRainRadius => TrentaConfigManagement.PurpleRainRadius.Value;
|
||||||
public static float PurpleRainHealAmount => TrentaConfigManagement.PurpleRainHealAmount.Value;
|
public static float PurpleRainHealAmount => TrentaConfigManagement.PurpleRainHealAmount.Value;
|
||||||
public static float PurpleRainPoisonDamage => TrentaConfigManagement.PurpleRainPoisonDamage.Value;
|
public static float PurpleRainPoisonDamage => TrentaConfigManagement.PurpleRainPoisonDamage.Value;
|
||||||
|
|
||||||
|
// The base figures plus the Blood Magic bonus, scaled linearly up to the full bonus at
|
||||||
|
// level 100 - the same shape as the Aswid's Vampiric Aura. The compendium reads these
|
||||||
|
// too, so its numbers follow the player's skill.
|
||||||
|
public static float PurpleRainHealFor(Player player) =>
|
||||||
|
PurpleRainHealAmount + BloodMagicFactor(player) * TrentaConfigManagement.PurpleRainBloodMagicHeal.Value;
|
||||||
|
public static float PurpleRainPoisonFor(Player player) =>
|
||||||
|
PurpleRainPoisonDamage + BloodMagicFactor(player) * TrentaConfigManagement.PurpleRainBloodMagicPoison.Value;
|
||||||
|
private static float BloodMagicFactor(Player player) =>
|
||||||
|
player != null ? player.GetSkillFactor(Skills.SkillType.BloodMagic) : 0f;
|
||||||
// A Poison-type hit; vanilla's own
|
// A Poison-type hit; vanilla's own
|
||||||
// poison-on-hit handling takes over from
|
// poison-on-hit handling takes over from
|
||||||
// there, same as SkeletonRace's fire aura
|
// there, same as SkeletonRace's fire aura
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,8 @@ namespace RacesOfValheim
|
||||||
public static ConfigEntry<float> PurpleRainRadius;
|
public static ConfigEntry<float> PurpleRainRadius;
|
||||||
public static ConfigEntry<float> PurpleRainHealAmount;
|
public static ConfigEntry<float> PurpleRainHealAmount;
|
||||||
public static ConfigEntry<float> PurpleRainPoisonDamage;
|
public static ConfigEntry<float> PurpleRainPoisonDamage;
|
||||||
|
public static ConfigEntry<float> PurpleRainBloodMagicHeal;
|
||||||
|
public static ConfigEntry<float> PurpleRainBloodMagicPoison;
|
||||||
|
|
||||||
// ─── Bonemass (tier 4+, passive) ──────────────────────────────────────
|
// ─── Bonemass (tier 4+, passive) ──────────────────────────────────────
|
||||||
public static ConfigEntry<float> SwimStaminaRegen;
|
public static ConfigEntry<float> SwimStaminaRegen;
|
||||||
|
|
@ -116,6 +118,10 @@ namespace RacesOfValheim
|
||||||
new ConfigDescription("Flat heal applied to you and to every ally hit.", new AcceptableValueRange<float>(0f, 200f)));
|
new ConfigDescription("Flat heal applied to you and to every ally hit.", new AcceptableValueRange<float>(0f, 200f)));
|
||||||
PurpleRainPoisonDamage = config.Bind(purpleRain, "Enemy Poison Damage", 40f,
|
PurpleRainPoisonDamage = config.Bind(purpleRain, "Enemy Poison Damage", 40f,
|
||||||
new ConfigDescription("Flat poison damage applied to every enemy hit.", new AcceptableValueRange<float>(0f, 200f)));
|
new ConfigDescription("Flat poison damage applied to every enemy hit.", new AcceptableValueRange<float>(0f, 200f)));
|
||||||
|
PurpleRainBloodMagicHeal = config.Bind(purpleRain, "Blood Magic Heal Bonus", 40f,
|
||||||
|
new ConfigDescription("Extra heal at 100 Blood Magic skill, added to Ally Heal Amount (scales linearly from 0).", new AcceptableValueRange<float>(0f, 200f)));
|
||||||
|
PurpleRainBloodMagicPoison = config.Bind(purpleRain, "Blood Magic Poison Bonus", 40f,
|
||||||
|
new ConfigDescription("Extra poison damage at 100 Blood Magic skill, added to Enemy Poison Damage (scales linearly from 0).", new AcceptableValueRange<float>(0f, 200f)));
|
||||||
|
|
||||||
const string bonemass = "Trenta - Bonemass";
|
const string bonemass = "Trenta - Bonemass";
|
||||||
SwimStaminaRegen = config.Bind(bonemass, "Swim Stamina Regen", 0.1f,
|
SwimStaminaRegen = config.Bind(bonemass, "Swim Stamina Regen", 0.1f,
|
||||||
|
|
|
||||||
|
|
@ -435,6 +435,7 @@ namespace RacesOfValheim
|
||||||
float totalDamage = baseDamage + unarmedSkillLevel;
|
float totalDamage = baseDamage + unarmedSkillLevel;
|
||||||
|
|
||||||
HashSet<GameObject> hit = new HashSet<GameObject>();
|
HashSet<GameObject> hit = new HashSet<GameObject>();
|
||||||
|
bool hitCreature = false;
|
||||||
foreach (Collider collider in Physics.OverlapSphere(center, radius))
|
foreach (Collider collider in Physics.OverlapSphere(center, radius))
|
||||||
{
|
{
|
||||||
Character target = collider.GetComponentInParent<Character>();
|
Character target = collider.GetComponentInParent<Character>();
|
||||||
|
|
@ -442,7 +443,12 @@ namespace RacesOfValheim
|
||||||
if (!BaseAI.IsEnemy(player, target)) continue;
|
if (!BaseAI.IsEnemy(player, target)) continue;
|
||||||
|
|
||||||
DealDamage(player, target, totalDamage, HitData.DamageType.Blunt, Vector3.zero);
|
DealDamage(player, target, totalDamage, HitData.DamageType.Blunt, Vector3.zero);
|
||||||
|
hitCreature = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The spike projectile levels Unarmed through vanilla's Projectile.OnHit; the stomp
|
||||||
|
// calls Damage directly and has to raise the skill itself.
|
||||||
|
if (hitCreature) FormMelee.RaiseSkill(Skills.SkillType.Unarmed);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
18
README.md
18
README.md
|
|
@ -15,9 +15,9 @@ Support the mod: [Patreon — NandorTheModder](https://www.patreon.com/c/NandorT
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## New in v1.6.8
|
## New in v1.6.9
|
||||||
|
|
||||||
**A Skeleton that eats, a bat that can't flee mid-fight, and a cheaper marble hall.** Each Skeleton player can choose to eat real food and to spend stamina. The Aswid can't take bat form until a few seconds after the last hit. The Dvergar build the black marble and Yggdrasil wood pieces with stone and fine wood. A faction can now fight as a group if you hit one of its own, and Valheim 1.0's new skeletons keep the swamp truce. Full details in the [changelog](#v168).
|
**Your own faction can be hit again, and race attacks train their skills.** Since Valheim 1.0 your blows passed straight through creatures of your own faction unless PvP was on, so no grudge ever started. That works again, in multiplayer too. Form attacks and powers now give XP to the skill they scale with, and Purple Rain grows with Blood Magic. Full details in the [changelog](#v169).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -296,7 +296,7 @@ Build a **Brood Mound** with the hammer — no more than two within its density
|
||||||
|
|
||||||
- **Base:** Tree-Born. Green skin/branches, plant diet, food lasts 2x. Photosynthesis: stand still in daylight for 10s = heal 10% max HP/sec for 8s, Rested buff (5 min +1min per boss). Greylings, greydwarves, fulings, trolls, leeches and deathsquitos ignore you.
|
- **Base:** Tree-Born. Green skin/branches, plant diet, food lasts 2x. Photosynthesis: stand still in daylight for 10s = heal 10% max HP/sec for 8s, Rested buff (5 min +1min per boss). Greylings, greydwarves, fulings, trolls, leeches and deathsquitos ignore you.
|
||||||
- **Eikthyr:** Awakened Seeds – eat seeds/cones/acorns/mushrooms for strong food buffs.
|
- **Eikthyr:** Awakened Seeds – eat seeds/cones/acorns/mushrooms for strong food buffs.
|
||||||
- **Elder:** Purple Rain (G): 8m toxic pollen heals you and your allies, poisons enemies, 20s CD.
|
- **Elder:** Purple Rain (G): 8m toxic pollen heals you and your allies, poisons enemies, 20s CD. Heal and poison grow with Blood Magic (+40 each at level 100), and a cast that reaches someone else trains it.
|
||||||
- **Bonemass:** Swim uses no stamina and stamina comes back slowly in the water, immune to Poison/Wet.
|
- **Bonemass:** Swim uses no stamina and stamina comes back slowly in the water, immune to Poison/Wet.
|
||||||
- **Moder:** Last Stand – armor rises as health falls (up to +50%), Thorns (reflects 20% damage).
|
- **Moder:** Last Stand – armor rises as health falls (up to +50%), Thorns (reflects 20% damage).
|
||||||
- **Yagluth:** Homecoming Portal (H): portal to respawn point, anyone can use, 5min CD.
|
- **Yagluth:** Homecoming Portal (H): portal to respawn point, anyone can use, 5min CD.
|
||||||
|
|
@ -492,6 +492,18 @@ Both halves have an off switch under `Factions` in Configuration Manager: **Fact
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### v1.6.9
|
||||||
|
- **Fix - you couldn't hit your own faction:** since Valheim 1.0, a player's hit passes through any creature the game calls friendly unless PvP is on, and the faction truce called every creature of your faction friendly. Your blows did nothing, no grudge started, and `Grudge spreads to kin` had nothing to spread. Hitting one of your own works again, and it and its kin fight back as intended. The truce still keeps them off you; it no longer shields them from you. Thanks to Joacwoo and CrimsonAiro for the reports. Not tested in game yet.
|
||||||
|
- **Fix - grudges in multiplayer:** a creature now keeps its grudge when another player's game takes over running it mid-fight, for example when the first player walks away or logs out. `Grudge spreads to kin` now also reaches kin that another player's game is running; before, they stayed calm until hit themselves. Every player needs this version: a creature run by an older client behaves the old way. Not tested in multiplayer yet.
|
||||||
|
- **New - race attacks train their skills:** many attacks grew with a skill but gave no XP for it, so the skill never moved. Now an attack that lands on a creature gives the XP a weapon hit gives, and damage over time gives a share per second. Hitting trees or rocks gives nothing. Not tested in game yet.
|
||||||
|
- Fenrir: the Fenring, Cultist, Wolf and Ulv claws and bites train Unarmed. The Cultist's fire breath trains Elemental Magic.
|
||||||
|
- Skadi: the Drake forms' bites and claws train Unarmed.
|
||||||
|
- Trenta: the Muspell stomp trains Unarmed.
|
||||||
|
- Aswid: the Vampiric Aura slowly trains Blood Magic.
|
||||||
|
- Alfar: Geisli and Ljosstorm train Elemental Magic. The Sameining pulse trains it slowly.
|
||||||
|
- **Change - Purple Rain grows with Blood Magic:** at level 100 it heals and poisons for 40 more than its base 40. The bonus has two new keys under `Trenta - Purple Rain`: `Blood Magic Heal Bonus` and `Blood Magic Poison Bonus`. A cast that reaches anyone besides you trains Blood Magic, and the Compendium shows your current numbers. Not tested in game yet.
|
||||||
|
- **Fix - pukeberries and the Aswid's fourth stomach:** pukeberries emptied only the three vanilla food slots, so the Aswid's fourth meal stayed. It now goes like the others. Thanks to Joacwoo for the report.
|
||||||
|
|
||||||
### v1.6.8
|
### v1.6.8
|
||||||
- **New - Skeleton Mortal Habits:** two options under `Skeleton - Mortal Habits`, both off by default, each player picking their own. *Eats Mortal Food*: the Skeleton eats like the living, and its health and stamina come from its meals. The boss-tier health bonus goes away, since it stood in for food. *Feels Fatigue*: the Skeleton spends stamina; if it doesn't eat, its stamina grows with its standing. Every other Skeleton power stays. Thanks to Celepito for the request. Not tested in game yet.
|
- **New - Skeleton Mortal Habits:** two options under `Skeleton - Mortal Habits`, both off by default, each player picking their own. *Eats Mortal Food*: the Skeleton eats like the living, and its health and stamina come from its meals. The boss-tier health bonus goes away, since it stood in for food. *Feels Fatigue*: the Skeleton spends stamina; if it doesn't eat, its stamina grows with its standing. Every other Skeleton power stays. Thanks to Celepito for the request. Not tested in game yet.
|
||||||
- **New - Aswid bat form waits out a fight:** you can't take bat form until 2.5 seconds after you last lost health, from a hit or a tick of fire, poison or bleeding. Turning back is never blocked, and a hit still doesn't knock you out of bat form. `Aswid - Bat Form` → `Combat Lock` sets the time; 0 turns it off. Not tested in game yet.
|
- **New - Aswid bat form waits out a fight:** you can't take bat form until 2.5 seconds after you last lost health, from a hit or a tick of fire, poison or bleeding. Turning back is never blocked, and a hit still doesn't knock you out of bat form. `Aswid - Bat Form` → `Combat Lock` sets the time; 0 turns it off. Not tested in game yet.
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "RacesOfValheim",
|
"name": "RacesOfValheim",
|
||||||
"description": "A Valheim mod that adds eleven custom playable races (Alfar, 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 eleven custom playable races (Alfar, 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.6.8",
|
"version_number": "1.6.9",
|
||||||
"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