Merge branch 'localisation' into localisation-turkish
This commit is contained in:
commit
47e0d9f127
6 changed files with 70 additions and 2 deletions
|
|
@ -54,9 +54,17 @@ namespace RacesOfValheim
|
|||
//
|
||||
// Skeleton_Hildir stays out deliberately, on the same rule that keeps GoblinKing and the
|
||||
// Hildir brothers out of the Black Forest set: a quest boss is not somebody's kin.
|
||||
//
|
||||
// Valheim 1.0 added a skeleton per region (the green swamp ones and the blue mountain ones
|
||||
// players noticed first), each with a melee-only twin, and spawners place those instead
|
||||
// of the plain Skeleton. Left out, they fought a Skeleton player the plain ones ignored.
|
||||
private static readonly HashSet<string> PaludeMobs = new HashSet<string>
|
||||
{
|
||||
"Ghost", "Skeleton", "Skeleton_NoArcher", "Skeleton_Poison", // Skeleton, Rancid remains
|
||||
"Skeleton_Meadows", "Skeleton_Meadows_noarcher",
|
||||
"Skeleton_Swamps", "Skeleton_Swamps_noarcher",
|
||||
"Skeleton_Mountains", "Skeleton_Mountains_noarcher",
|
||||
"Skeleton_DeepNorth",
|
||||
"Draugr", "Draugr_Elite", "Draugr_Ranged",
|
||||
"Wraith", "Leech", "Abomination",
|
||||
"Blob", "BlobElite", "BlobTar", // Blob, Oozer, Growth
|
||||
|
|
|
|||
|
|
@ -337,7 +337,16 @@ namespace RacesOfValheim
|
|||
{ "Draugr_Elite", DraugrShop },
|
||||
|
||||
{ "Skeleton", SkeletonShop },
|
||||
{ "Skeleton_NoArcher", SkeletonShop },
|
||||
{ "Skeleton_Poison", SkeletonShop },
|
||||
// Valheim 1.0's regional skeletons, the ones its spawners actually place.
|
||||
{ "Skeleton_Meadows", SkeletonShop },
|
||||
{ "Skeleton_Meadows_noarcher", SkeletonShop },
|
||||
{ "Skeleton_Swamps", SkeletonShop },
|
||||
{ "Skeleton_Swamps_noarcher", SkeletonShop },
|
||||
{ "Skeleton_Mountains", SkeletonShop },
|
||||
{ "Skeleton_Mountains_noarcher", SkeletonShop },
|
||||
{ "Skeleton_DeepNorth", SkeletonShop },
|
||||
|
||||
{ "Ghost", GhostShop },
|
||||
{ "Wraith", WraithShop },
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ namespace RacesOfValheim
|
|||
public static ConfigEntry<bool> HostilityEnabled;
|
||||
public static ConfigEntry<bool> MerchantsEnabled;
|
||||
public static ConfigEntry<float> GrudgeDuration;
|
||||
public static ConfigEntry<bool> GrudgeSpreadEnabled;
|
||||
public static ConfigEntry<float> GrudgeSpreadRadius;
|
||||
|
||||
// Null-safe, defaulting to ON, for the same reason WarVultureConfig guards its own reads:
|
||||
// a patch that somehow runs before Bind() should behave like the shipped default rather
|
||||
|
|
@ -28,6 +30,8 @@ namespace RacesOfValheim
|
|||
public static bool Hostility => HostilityEnabled?.Value ?? true;
|
||||
public static bool Merchants => MerchantsEnabled?.Value ?? true;
|
||||
public static float GrudgeSeconds => GrudgeDuration?.Value ?? 60f;
|
||||
public static bool GrudgeSpreads => GrudgeSpreadEnabled?.Value ?? false;
|
||||
public static float GrudgeSpreadMeters => GrudgeSpreadRadius?.Value ?? 20f;
|
||||
|
||||
public static void Bind(ConfigFile config)
|
||||
{
|
||||
|
|
@ -60,6 +64,18 @@ namespace RacesOfValheim
|
|||
"old absolute truce.",
|
||||
new AcceptableValueRange<float>(0f, 600f)));
|
||||
|
||||
// Joacwoo's request: the truce made the swamp and the crypts a walk for a Skeleton,
|
||||
// since only the one creature you hit ever fought back.
|
||||
GrudgeSpreadEnabled = config.Bind(factions, "Grudge spreads to kin", false,
|
||||
new ConfigDescription("Off: only the creature you hit fights back. On: hit a creature of your " +
|
||||
"own faction and every creature of that faction near it turns on you too, " +
|
||||
"for the same Faction grudge time, the way vanilla's Dvergr treat a human. " +
|
||||
"Peace still holds until you strike first."));
|
||||
GrudgeSpreadRadius = config.Bind(factions, "Grudge spread radius", 20f,
|
||||
new ConfigDescription("Meters around the creature you hit within which its kin join the fight, " +
|
||||
"with Grudge spreads to kin on.",
|
||||
new AcceptableValueRange<float>(5f, 60f)));
|
||||
|
||||
MerchantsEnabled = config.Bind(factions, "Faction merchants", true,
|
||||
new ConfigDescription("Certain mobs of your own faction can be traded with - 'E - Talk' opens a shop " +
|
||||
"where you sell them what their kind wants. Turn this off and they are ordinary " +
|
||||
|
|
|
|||
|
|
@ -121,6 +121,35 @@ namespace RacesOfValheim
|
|||
if (monster == null || monster.IsPlayer()) return;
|
||||
|
||||
Remember(monster, attacker);
|
||||
if (FactionsConfig.GrudgeSpreads && attacker is Player player) SpreadToKin(monster, player);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// Only the creatures this machine runs the AI for are told, because a grudge is read where
|
||||
/// the AI runs (see WHERE IT RUNS above). The creatures around the one that was hit are
|
||||
/// nearly always simulated by the same client; one owned by another player's machine stays
|
||||
/// at peace until it is hit itself.
|
||||
/// </summary>
|
||||
private static void SpreadToKin(Character monster, Player player)
|
||||
{
|
||||
string race = FactionHostilityPatch.GetPlayerRace(player);
|
||||
if (!FactionHostilityPatch.IsAlliedMob(race, monster.gameObject.name)) return;
|
||||
|
||||
Vector3 center = monster.transform.position;
|
||||
float radius = FactionsConfig.GrudgeSpreadMeters;
|
||||
foreach (Character other in Character.GetAllCharacters())
|
||||
{
|
||||
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 (!FactionHostilityPatch.IsAlliedMob(race, other.gameObject.name)) continue;
|
||||
|
||||
Remember(other, player);
|
||||
other.GetBaseAI()?.Alert();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -872,6 +872,10 @@ namespace RacesOfValheim
|
|||
if (name == "skeleton" ||
|
||||
name == "skeleton_noarcher" ||
|
||||
name == "skeleton_poison" ||
|
||||
name == "skeleton_meadows" || name == "skeleton_meadows_noarcher" ||
|
||||
name == "skeleton_swamps" || name == "skeleton_swamps_noarcher" ||
|
||||
name == "skeleton_mountains" || name == "skeleton_mountains_noarcher" ||
|
||||
name == "skeleton_deepnorth" ||
|
||||
name == "skeleton_friendly" ||
|
||||
name.StartsWith("draugr") ||
|
||||
name == "ghost" ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue