RacesOfValheim/JotunnModStub/Alfar/AlfarNexusConfig.cs
kanym bba81cbbf0 fix: Grafvaettir drones mine copper, scrap and tin
The default Mining Targets list named MineRock_Copper, but Black Forest copper is rock4_copper, so drones thrown at copper found no target and hovered where they spawned. Add rock4_copper and mudpile, and move configs still on the old default.

Drones now measure and aim at the nearest live hit area instead of the deposit root, which sits inside big rocks. Hits carry the drone as attacker: vanilla MineRock reads the attacker's ZDOID without a null check and threw on every tin hit.
2026-10-29 01:26:46 +01:00

149 lines
13 KiB
C#

using BepInEx.Configuration;
using UnityEngine;
namespace RacesOfValheim
{
/// <summary>
/// The numbers of the Alfar's base: the Nexus, its drones, the constructs, the towers and the
/// crystals (Alfar_Progettazione.txt sec. 8, 9 and 19). All starting values, all to be corrected
/// in play, none in the logic files.
/// </summary>
public static class AlfarNexusConfig
{
// The progression state the constructs open at (BossProgressionManager: 6 = Yagluth down).
public const int ConstructState = 6;
// ─── The Nexus ───────────────────────────────────────────────────────
public static ConfigEntry<float> NexusRadius;
public static ConfigEntry<float> NexusDensityKm2;
public static ConfigEntry<int> NexusBronze;
public static ConfigEntry<int> NexusStone;
// ─── Drones ──────────────────────────────────────────────────────────
public static ConfigEntry<int> DroneBronze;
public static ConfigEntry<int> DroneCap;
public static ConfigEntry<float> DroneHealth;
public static ConfigEntry<float> DroneZapDamage;
public static ConfigEntry<float> DroneZapInterval;
// ─── Mining drones ───────────────────────────────────────────────────
public static ConfigEntry<string> MinerDeposits;
public static ConfigEntry<float> MinerDamage;
public static ConfigEntry<string> WildPickables;
// ─── Constructs ──────────────────────────────────────────────────────
public static ConfigEntry<int> NeistMetal;
public static ConfigEntry<int> NeistCrystal;
public static ConfigEntry<int> NeistEitr;
public static ConfigEntry<int> NeistCap;
public static ConfigEntry<int> EldingMetal;
public static ConfigEntry<int> EldingCrystal;
public static ConfigEntry<int> EldingEitr;
public static ConfigEntry<int> EldingCap;
public static ConfigEntry<int> SteinMetal;
public static ConfigEntry<int> SteinCrystal;
public static ConfigEntry<int> SteinEitr;
public static ConfigEntry<int> SteinCap;
public static ConfigEntry<float> ConstructLeash;
public static ConfigEntry<float> ConstructAlertRange;
public static ConfigEntry<float> WitherSeconds;
public static ConfigEntry<float> SphereDamage;
public static ConfigEntry<float> SphereIntervalSeconds;
public static ConfigEntry<float> SphereRange;
// ─── Crystals ────────────────────────────────────────────────────────
public static ConfigEntry<int> UpgradeCrystals;
public static ConfigEntry<int> CrystalCap;
public static ConfigEntry<float> CrystalTimeFactor;
// ─── Towers ──────────────────────────────────────────────────────────
public static ConfigEntry<int> TowerBronze;
public static ConfigEntry<int> TowerCrystal;
public static ConfigEntry<float> TowerHealthFactor;
public static ConfigEntry<float> TowerDamage;
public static ConfigEntry<float> TowerScale;
// ─── Ljosgard (sap) and chests ───────────────────────────────────────
public static ConfigEntry<int> GardBronze;
public static ConfigEntry<int> GardMushrooms;
public static ConfigEntry<float> GardSecondsPerSap;
public static ConfigEntry<int> GardCapacity;
public static ConfigEntry<int> ChestEyes;
public static void Bind(ConfigFile config)
{
const string nexus = "Alfar - Nexus";
NexusRadius = config.Bind(nexus, "Radius", 40f, new ConfigDescription("Metres around a Ljoskjarne where its drones work and its towers run.", new AcceptableValueRange<float>(10f, 150f)));
NexusDensityKm2 = config.Bind(nexus, "Density Km2", 1.6f, new ConfigDescription("At most one Ljoskjarne per this many square kilometres.", new AcceptableValueRange<float>(0.1f, 20f)));
NexusBronze = config.Bind(nexus, "Bronze Cost", 40, new ConfigDescription("Bronze to build a Ljoskjarne.", new AcceptableValueRange<int>(0, 500)));
NexusStone = config.Bind(nexus, "Stone Cost", 30, new ConfigDescription("Stone to build a Ljoskjarne.", new AcceptableValueRange<int>(0, 500)));
const string drone = "Alfar - Drones";
DroneBronze = config.Bind(drone, "Bronze Cost", 8, new ConfigDescription("Bronze for each Ljosvaettir.", new AcceptableValueRange<int>(0, 200)));
DroneCap = config.Bind(drone, "Cap Per Nexus", 6, new ConfigDescription("Most drones one Ljoskjarne keeps.", new AcceptableValueRange<int>(0, 50)));
DroneHealth = config.Bind(drone, "Health", 25f, new ConfigDescription("A drone's health and shield (a Deathsquito has 10).", new AcceptableValueRange<float>(1f, 1000f)));
DroneZapDamage = config.Bind(drone, "Zap Damage", 1f, new ConfigDescription("Lightning damage of a drone's defensive zap.", new AcceptableValueRange<float>(0f, 100f)));
DroneZapInterval = config.Bind(drone, "Zap Interval", 2f, new ConfigDescription("Seconds between a drone's zaps.", new AcceptableValueRange<float>(0.2f, 30f)));
// Copper deposits are rock4_copper (and rock4_copper_frac once hit), crypt scrap is mudpile;
// the first default missed both, so a config still holding it is moved to the new one.
const string oldTargets = "MineRock_Copper,MineRock_Tin,MineRock_Iron,silvervein,rock3_silver,giant_brain";
const string targets = "rock4_copper,MineRock_Copper,MineRock_Tin,MineRock_Iron,mudpile,silvervein,rock3_silver,giant_brain";
MinerDeposits = config.Bind(drone, "Mining Targets", targets,
new ConfigDescription("Comma separated parts of prefab names the mining drones dig (case does not matter). Soft tissue comes from giant_brain."));
if (MinerDeposits.Value == oldTargets) MinerDeposits.Value = targets;
MinerDamage = config.Bind(drone, "Mining Damage", 40f, new ConfigDescription("Pickaxe damage each mining drone does per second to a deposit.", new AcceptableValueRange<float>(1f, 1000f)));
WildPickables = config.Bind(drone, "Wild Plants Harvested", "Pickable_Mushroom,Pickable_Dandelion,Pickable_Thistle,RaspberryBush,BlueberryBush,CloudberryBush",
new ConfigDescription("Comma separated parts of prefab names of WILD plants the drones pick without replanting (mushrooms, berry bushes, flowers). Trees are never touched. Cultivated crops are always replanted."));
const string construct = "Alfar - Constructs";
NeistMetal = config.Bind(construct, "Neistvordr Bronze", 20, new ConfigDescription("Bronze for a Neistvordr.", new AcceptableValueRange<int>(0, 500)));
NeistCrystal = config.Bind(construct, "Neistvordr Crystal", 3, new ConfigDescription("Crystals for a Neistvordr.", new AcceptableValueRange<int>(0, 50)));
NeistEitr = config.Bind(construct, "Neistvordr Refined Eitr", 3, new ConfigDescription("Refined eitr for a Neistvordr.", new AcceptableValueRange<int>(0, 50)));
NeistCap = config.Bind(construct, "Neistvordr Cap", 4, new ConfigDescription("Most Neistvordr one Ljoskjarne keeps.", new AcceptableValueRange<int>(0, 50)));
EldingMetal = config.Bind(construct, "Eldingvordr Iron", 20, new ConfigDescription("Iron for an Eldingvordr.", new AcceptableValueRange<int>(0, 500)));
EldingCrystal = config.Bind(construct, "Eldingvordr Crystal", 5, new ConfigDescription("Crystals for an Eldingvordr.", new AcceptableValueRange<int>(0, 50)));
EldingEitr = config.Bind(construct, "Eldingvordr Refined Eitr", 4, new ConfigDescription("Refined eitr for an Eldingvordr.", new AcceptableValueRange<int>(0, 50)));
EldingCap = config.Bind(construct, "Eldingvordr Cap", 4, new ConfigDescription("Most Eldingvordr one Ljoskjarne keeps.", new AcceptableValueRange<int>(0, 50)));
SteinMetal = config.Bind(construct, "Steinvordr Black Metal", 20, new ConfigDescription("Black metal for a Steinvordr.", new AcceptableValueRange<int>(0, 500)));
SteinCrystal = config.Bind(construct, "Steinvordr Crystal", 8, new ConfigDescription("Crystals for a Steinvordr.", new AcceptableValueRange<int>(0, 50)));
SteinEitr = config.Bind(construct, "Steinvordr Refined Eitr", 6, new ConfigDescription("Refined eitr for a Steinvordr.", new AcceptableValueRange<int>(0, 50)));
SteinCap = config.Bind(construct, "Steinvordr Cap", 1, new ConfigDescription("Most Steinvordr one Ljoskjarne keeps.", new AcceptableValueRange<int>(0, 50)));
ConstructLeash = config.Bind(construct, "Leash Range", 12f, new ConfigDescription("How far a construct wanders from its Ljoskjarne when not following.", new AcceptableValueRange<float>(2f, 80f)));
ConstructAlertRange = config.Bind(construct, "Alert Range", 25f, new ConfigDescription("How far a construct notices and chases enemies.", new AcceptableValueRange<float>(5f, 100f)));
WitherSeconds = config.Bind(construct, "Wither Seconds", 60f, new ConfigDescription("How long creatures last after their Ljoskjarne falls.", new AcceptableValueRange<float>(0f, 600f)));
SphereDamage = config.Bind(construct, "Sphere Damage", 80f, new ConfigDescription("Lightning damage of the Eldingvordr's sphere.", new AcceptableValueRange<float>(1f, 1000f)));
SphereIntervalSeconds = config.Bind(construct, "Sphere Interval", 8f, new ConfigDescription("Seconds between the Eldingvordr's shots.", new AcceptableValueRange<float>(0.5f, 60f)));
SphereRange = config.Bind(construct, "Sphere Range", 30f, new ConfigDescription("How far the Eldingvordr shoots.", new AcceptableValueRange<float>(5f, 80f)));
const string crystal = "Alfar - Crystals";
UpgradeCrystals = config.Bind(crystal, "Upgrade Cost", 20, new ConfigDescription("Crystals the player must find for the Kristallvigsla.", new AcceptableValueRange<int>(0, 200)));
CrystalCap = config.Bind(crystal, "Stored Cap", 20, new ConfigDescription("Most crystals the Ljoskjarne holds before it stops making them.", new AcceptableValueRange<int>(1, 200)));
CrystalTimeFactor = config.Bind(crystal, "Time Factor", 2f, new ConfigDescription("A crystal takes this many times a vanilla beehive's time for one honey.", new AcceptableValueRange<float>(0.1f, 20f)));
const string tower = "Alfar - Towers";
TowerBronze = config.Bind(tower, "Bronze Cost", 25, new ConfigDescription("Bronze for a Prismavard.", new AcceptableValueRange<int>(0, 500)));
TowerCrystal = config.Bind(tower, "Crystal Cost", 2, new ConfigDescription("Crystals for a Prismavard.", new AcceptableValueRange<int>(0, 50)));
TowerHealthFactor = config.Bind(tower, "Health Factor", 0.5f, new ConfigDescription("A Prismavard's health against the charred ballista's 400.", new AcceptableValueRange<float>(0.05f, 3f)));
TowerDamage = config.Bind(tower, "Bolt Damage", 40f, new ConfigDescription("Lightning damage of a Prismavard's bolt.", new AcceptableValueRange<float>(1f, 1000f)));
TowerScale = config.Bind(tower, "Scale", 0.6f, new ConfigDescription("Size of a Prismavard against the charred ballista.", new AcceptableValueRange<float>(0.2f, 2f)));
const string gard = "Alfar - Ljosgard";
GardBronze = config.Bind(gard, "Bronze Cost", 40, new ConfigDescription("Bronze for a Ljosgard.", new AcceptableValueRange<int>(0, 500)));
GardMushrooms = config.Bind(gard, "Mushrooms Cost", 10, new ConfigDescription("Jotun Puffs AND Magecap, this many of each, to build a Ljosgard.", new AcceptableValueRange<int>(0, 100)));
GardSecondsPerSap = config.Bind(gard, "Seconds Per Sap", 600f, new ConfigDescription("Seconds to turn one Jotun Puffs and one Magecap into a Sap.", new AcceptableValueRange<float>(10f, 7200f)));
GardCapacity = config.Bind(gard, "Sap Capacity", 10, new ConfigDescription("Sap the Ljosgard holds before it stops.", new AcceptableValueRange<int>(1, 200)));
ChestEyes = config.Bind(gard, "Chest Greydwarf Eyes", 3, new ConfigDescription("Greydwarf eyes in the price of the entry chest and the wood chest.", new AcceptableValueRange<int>(0, 50)));
}
}
}