warvulture
This commit is contained in:
parent
3095198539
commit
1d66b00374
29 changed files with 7236 additions and 4 deletions
271
JotunnModStub/Sverm/SvermConfigManagement.cs
Normal file
271
JotunnModStub/Sverm/SvermConfigManagement.cs
Normal file
|
|
@ -0,0 +1,271 @@
|
|||
using BepInEx.Configuration;
|
||||
|
||||
namespace RacesOfValheim
|
||||
{
|
||||
/// <summary>
|
||||
/// The BepInEx-configurable slice of the Sverm's numbers, bound as ConfigEntry so they can be
|
||||
/// retuned without a rebuild - see CONFIGURATION-MANAGER-HOWTO.md. Bound once, from
|
||||
/// RacesOfValheim.Awake().
|
||||
///
|
||||
/// Configuration Manager is a convenience, not a requirement: these land in
|
||||
/// BepInEx/config/com.nandor.racesofvalheim.cfg as plain text and can be edited with a text
|
||||
/// editor and picked up on the next launch.
|
||||
///
|
||||
/// WHAT IS IN HERE AND WHAT IS NOT, on the same boundary DvergarConfigManagement draws:
|
||||
/// SvermConfig keeps the identity constants that must never change once a character exists
|
||||
/// (RaceId, status effect names) and the per-tier tables. What lives here is the handful of
|
||||
/// numbers that can only be judged by looking at them on screen - where the claws sit on the
|
||||
/// hand, how wide the wings open - because those are guesses until someone sees them, and a
|
||||
/// guess that needs a rebuild to correct is a guess that gets corrected slowly.
|
||||
/// </summary>
|
||||
public static class SvermConfigManagement
|
||||
{
|
||||
// No claw entries. They were here for one build, while the claws were a model bolted to
|
||||
// the hand bones and their angle was a guess only an eye could settle. They are a real
|
||||
// equipped item now (SvermClawSlot), so the game's own attach point decides where they sit
|
||||
// and there is nothing left to tune.
|
||||
|
||||
// ─── Dorsal spines ───────────────────────────────────────────────────
|
||||
public static ConfigEntry<float> SpineSizeSmall;
|
||||
public static ConfigEntry<float> SpineSizeFull;
|
||||
public static ConfigEntry<string> SpineBoneName;
|
||||
public static ConfigEntry<float> SpineRotationX;
|
||||
public static ConfigEntry<float> SpineRotationY;
|
||||
public static ConfigEntry<float> SpineRotationZ;
|
||||
|
||||
// ─── Emberform ───────────────────────────────────────────────────────
|
||||
public static ConfigEntry<float> EmberGlowStrength;
|
||||
|
||||
// ─── Keybinds ────────────────────────────────────────────────────────
|
||||
public static ConfigEntry<KeyboardShortcut> StingerKey;
|
||||
|
||||
// ─── Stinger Morph, the model ────────────────────────────────────────
|
||||
public static ConfigEntry<float> StingerScaleMultiplier;
|
||||
public static ConfigEntry<float> StingerYawDegrees;
|
||||
|
||||
// ─── Colony caps ─────────────────────────────────────────────────────
|
||||
// Every ceiling on how many things the colony can have alive at once, in one section, so
|
||||
// the "is this too many creatures for my machine" question has exactly one place to be
|
||||
// answered - and can be answered without a rebuild.
|
||||
//
|
||||
// The nest density limit is deliberately NOT here. Two per square mile is a rule about
|
||||
// what the world may look like rather than a comfort setting, and PieceDensityLimit reads
|
||||
// it once when the piece registers.
|
||||
public static ConfigEntry<int> CapBrood;
|
||||
public static ConfigEntry<int> CapSeeker;
|
||||
public static ConfigEntry<int> CapSoldier;
|
||||
public static ConfigEntry<int> CapGjall;
|
||||
public static ConfigEntry<int> CapBlisterTick;
|
||||
public static ConfigEntry<int> CapFarmers;
|
||||
public static ConfigEntry<int> CapHaulers;
|
||||
public static ConfigEntry<int> CapBeehives;
|
||||
|
||||
// ─── The nest and its mark ───────────────────────────────────────────
|
||||
public static ConfigEntry<float> WorkerChestRangeValue;
|
||||
public static ConfigEntry<bool> WorkerDebugValue;
|
||||
public static ConfigEntry<float> HiveScaleValue;
|
||||
public static ConfigEntry<float> EggSizeValue;
|
||||
public static ConfigEntry<float> EggHeightValue;
|
||||
public static ConfigEntry<float> DigestRateValue;
|
||||
public static ConfigEntry<float> StomachSizeValue;
|
||||
public static ConfigEntry<float> StomachHeightValue;
|
||||
public static ConfigEntry<float> MarketSizeValue;
|
||||
public static ConfigEntry<float> StageGrowthValue;
|
||||
public static ConfigEntry<float> NestVfxScaleValue;
|
||||
public static ConfigEntry<float> BeehiveVfxScaleValue;
|
||||
|
||||
public static void Bind(ConfigFile config)
|
||||
{
|
||||
const string spines = "Sverm - Dorsal Spines";
|
||||
const string ember = "Sverm - Emberform";
|
||||
const string keybinds = "Sverm - Keybinds";
|
||||
|
||||
// G, like every other first transformation in the mod - the Aswid's bat, the Fenrir's
|
||||
// wolf, the Dvergar's ping. A character only ever has one race, so they never collide.
|
||||
StingerKey = config.Bind(keybinds, "Stinger Morph", new KeyboardShortcut(UnityEngine.KeyCode.G),
|
||||
"Turns into a Deathsquito, and back. Unlocked at Yagluth.");
|
||||
|
||||
const string stinger = "Sverm - Stinger Morph";
|
||||
|
||||
StingerScaleMultiplier = config.Bind(stinger, "Scale", 1f,
|
||||
"Multiplies the deathsquito model's OWN authored scale. 1 means 'the size the " +
|
||||
"game draws one'. Raise it if the insect reads as too small to be you.");
|
||||
|
||||
const string nest = "Sverm - Nest";
|
||||
|
||||
HiveScaleValue = config.Bind(nest, "Nest Scale", SvermConfig.HiveScale,
|
||||
"How big the nest is. Only affects nests placed AFTER the change - the ones already " +
|
||||
"standing keep the size they were built at, like every other building.");
|
||||
|
||||
EggSizeValue = config.Bind(nest, "Infection Egg Size", SvermConfig.HiveEggSize,
|
||||
"How big the egg on a taken beehive is, in metres. The first pass used 0.35 and it " +
|
||||
"was invisible in play.");
|
||||
|
||||
EggHeightValue = config.Bind(nest, "Infection Egg Height", SvermConfig.HiveEggHeight,
|
||||
"How far above the beehive's own origin the egg sits, in metres. Too high and it " +
|
||||
"floats clear of the roof; too low and it sinks into the mesh.");
|
||||
|
||||
// The two hives you press. Sizes are also how wide the sphere you point at is, so these
|
||||
// decide how easy each mouth is to hit as much as how it looks. Read once, when the
|
||||
// piece is registered: a change here shows up on the next launch, not on nests already
|
||||
// standing.
|
||||
StomachSizeValue = config.Bind(nest, "Stomach Size", SvermConfig.StomachSize,
|
||||
"How big the hive at the foot of the nest is, in metres. It is the one you feed: " +
|
||||
"press E on it and a whole stack goes in.");
|
||||
|
||||
StomachHeightValue = config.Bind(nest, "Stomach Height", SvermConfig.StomachHeight,
|
||||
"How far up the trunk the stomach sits, in metres. Zero puts it on the ground.");
|
||||
|
||||
// NOT "Market Size" - that key already exists in everyone's .cfg holding the size of the
|
||||
// mouth that used to hang on the trunk, and a key that is read back from a file laughs
|
||||
// at a changed default. The market is a building of its own now and this is its scale,
|
||||
// so it gets a name of its own too; the two old lines are orphans and are ignored.
|
||||
StageGrowthValue = config.Bind(nest, "Growth At Last Stage", SvermConfig.HiveStageGrowth,
|
||||
"How big a Hive Citadel is compared to the Brood Mound it started as, with the two " +
|
||||
"middle stages spread evenly between. Applies to nests already standing, since it " +
|
||||
"is worked out from the stage rather than baked in at placement.");
|
||||
|
||||
NestVfxScaleValue = config.Bind(nest, "Nest Swarm Scale", SvermConfig.NestVfxScale,
|
||||
"How big the cloud of flies over the nest is, and the green reek it gives off while " +
|
||||
"it is digesting. The reek only shows when there is something going down.");
|
||||
|
||||
BeehiveVfxScaleValue = config.Bind(nest, "Beehive Swarm Scale", SvermConfig.BeehiveVfxScale,
|
||||
"The same two marks on a taken beehive, which wants a smaller cloud than the nest. " +
|
||||
"Its gas shows when the hive is full of honey.");
|
||||
|
||||
MarketSizeValue = config.Bind(nest, "Market Bench Size", SvermConfig.MarketSize,
|
||||
"How big the Hive Market bench is, in metres. It is a building you raise inside a " +
|
||||
"hive's ten metres, not a part of the nest.");
|
||||
|
||||
DigestRateValue = config.Bind(nest, "Digestion Rate", SvermConfig.BiomassDigestRate,
|
||||
"How much biomass moves from digestion into the hive's spendable bank each second. " +
|
||||
"What you sell the hive is not spendable until it has gone down. At the default a " +
|
||||
"full stage-one tank takes a little over three minutes. Measured against the world " +
|
||||
"clock, so a hive nobody is watching digests at the same speed.");
|
||||
|
||||
const string workers = "Sverm - Workers";
|
||||
|
||||
WorkerChestRangeValue = config.Bind(workers, "Chest Range", SvermConfig.WorkerChestRange,
|
||||
"How far from the nest or the beehive a worker will look for a chest, in metres. " +
|
||||
"Three is the design figure; widen it if your storage will not fit that close.");
|
||||
|
||||
WorkerDebugValue = config.Bind(workers, "Log Rounds", false,
|
||||
"Writes a line to the log when a worker finishes a round and found nothing to do. " +
|
||||
"Off by default because a worker works every few seconds and would bury the log.");
|
||||
|
||||
const string caps = "Sverm - Colony Caps";
|
||||
|
||||
CapBrood = config.Bind(caps, "Brood", SvermConfig.CapBrood,
|
||||
"How many Seeker Brood the colony can keep alive at once.");
|
||||
CapSeeker = config.Bind(caps, "Seeker", SvermConfig.CapSeeker,
|
||||
"How many Seekers the colony can keep alive at once.");
|
||||
CapSoldier = config.Bind(caps, "Soldier", SvermConfig.CapSoldier,
|
||||
"How many Seeker Soldiers the colony can keep alive at once.");
|
||||
CapGjall = config.Bind(caps, "Gjall", SvermConfig.CapGjall,
|
||||
"How many Gjall the colony can keep alive at once.");
|
||||
|
||||
CapBlisterTick = config.Bind(caps, "Blister Ticks", SvermConfig.CapBlisterTick,
|
||||
"How many bomb ticks the colony can keep alive at once. They respawn for free, so " +
|
||||
"this number is also how many explosions are in the air at any moment.");
|
||||
|
||||
CapFarmers = config.Bind(caps, "Worker - Farmers", SvermConfig.CapFarmers,
|
||||
"Seeker Workers produced by infected beehives, the ones that plant and harvest. " +
|
||||
"Separate pool from the haulers.");
|
||||
CapHaulers = config.Bind(caps, "Worker - Haulers", SvermConfig.CapHaulers,
|
||||
"Seeker Workers produced by the nest after Bonemass, the ones that carry food from " +
|
||||
"nearby chests into the hive. Separate pool from the farmers.");
|
||||
|
||||
CapBeehives = config.Bind(caps, "Beehives per Aura", SvermConfig.HiveAuraBeehiveMax,
|
||||
"How many beehives may stand in one nest's ten metres. Every one of them ends up " +
|
||||
"infected and producing a worker, so this is the number that really decides how " +
|
||||
"busy a base gets.");
|
||||
|
||||
StingerYawDegrees = config.Bind(stinger, "Yaw", 180f,
|
||||
"Turns the model on the vertical axis, in degrees. The creature's forward is not " +
|
||||
"the player's, so without this it flies looking back at you. 180 is the usual " +
|
||||
"answer; try 90 or -90 if it comes out sideways.");
|
||||
|
||||
EmberGlowStrength = config.Bind(ember, "Glow Strength", SvermConfig.EmberGlowStrength,
|
||||
"How hot the chitin burns at Fader. This multiplies an HDR colour and it is applied " +
|
||||
"to the chest, the legs and the helmet at once, so it goes a very long way. Settled " +
|
||||
"in game at 0.0625 after 1.0 blinded and 0.25 was still too bright. Above the bloom " +
|
||||
"threshold more brightness buys a bigger white area and less red, so tune downward.");
|
||||
|
||||
SpineSizeSmall = config.Bind(spines, "Size Vestigial", SvermConfig.SpineSizeSmall,
|
||||
"How tall the dorsal spines stand, in metres, from Moder to the Queen.");
|
||||
|
||||
SpineSizeFull = config.Bind(spines, "Size Full", SvermConfig.SpineSizeFull,
|
||||
"How tall they stand from the Queen on.");
|
||||
|
||||
SpineBoneName = config.Bind(spines, "Bone", SvermConfig.SpineBoneName,
|
||||
"Which bone the spines ride. This bone and no other - there is no fallback, so a " +
|
||||
"name that is not in the rig means no crest at all. Leave it blank to use " +
|
||||
"Spine3.");
|
||||
|
||||
// Defaults are the values found in game with the crest on screen, not zeroes: changing
|
||||
// nothing here now reproduces the placement that was actually approved.
|
||||
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.");
|
||||
SpineRotationZ = config.Bind(spines, "Rotation Z", SvermConfig.SpineRotationZ, "Roll of the spines, in degrees.");
|
||||
}
|
||||
|
||||
// ─── Live reads ──────────────────────────────────────────────────────
|
||||
// Null-guarded so the placement code works whether or not Bind has run - the main-menu
|
||||
// character preview can build a body before Awake has finished on a slow load.
|
||||
|
||||
public static UnityEngine.Quaternion SpineRotation()
|
||||
{
|
||||
return UnityEngine.Quaternion.Euler(
|
||||
SpineRotationX?.Value ?? SvermConfig.SpineRotationX,
|
||||
SpineRotationY?.Value ?? SvermConfig.SpineRotationY,
|
||||
SpineRotationZ?.Value ?? SvermConfig.SpineRotationZ);
|
||||
}
|
||||
|
||||
public static float EmberStrength => EmberGlowStrength?.Value ?? SvermConfig.EmberGlowStrength;
|
||||
|
||||
public static int Brood => CapBrood?.Value ?? SvermConfig.CapBrood;
|
||||
public static int Seeker => CapSeeker?.Value ?? SvermConfig.CapSeeker;
|
||||
public static int Soldier => CapSoldier?.Value ?? SvermConfig.CapSoldier;
|
||||
public static int Gjall => CapGjall?.Value ?? SvermConfig.CapGjall;
|
||||
public static int BlisterTick => CapBlisterTick?.Value ?? SvermConfig.CapBlisterTick;
|
||||
public static int Farmers => CapFarmers?.Value ?? SvermConfig.CapFarmers;
|
||||
public static int Haulers => CapHaulers?.Value ?? SvermConfig.CapHaulers;
|
||||
public static int Beehives => CapBeehives?.Value ?? SvermConfig.HiveAuraBeehiveMax;
|
||||
|
||||
public static float ChestRange => WorkerChestRangeValue?.Value ?? SvermConfig.WorkerChestRange;
|
||||
public static bool WorkerDebug => WorkerDebugValue?.Value ?? false;
|
||||
|
||||
public static float HiveScale => HiveScaleValue?.Value ?? SvermConfig.HiveScale;
|
||||
public static float EggSize => EggSizeValue?.Value ?? SvermConfig.HiveEggSize;
|
||||
public static float EggHeight => EggHeightValue?.Value ?? SvermConfig.HiveEggHeight;
|
||||
public static float DigestRate => DigestRateValue?.Value ?? SvermConfig.BiomassDigestRate;
|
||||
public static float StomachSize => StomachSizeValue?.Value ?? SvermConfig.StomachSize;
|
||||
public static float StomachHeight => StomachHeightValue?.Value ?? SvermConfig.StomachHeight;
|
||||
public static float MarketSize => MarketSizeValue?.Value ?? SvermConfig.MarketSize;
|
||||
public static float StageGrowth => StageGrowthValue?.Value ?? SvermConfig.HiveStageGrowth;
|
||||
public static float NestVfxScale => NestVfxScaleValue?.Value ?? SvermConfig.NestVfxScale;
|
||||
public static float BeehiveVfxScale => BeehiveVfxScaleValue?.Value ?? SvermConfig.BeehiveVfxScale;
|
||||
|
||||
public static float StingerScale => StingerScaleMultiplier?.Value ?? 1f;
|
||||
public static float StingerYaw => StingerYawDegrees?.Value ?? 180f;
|
||||
|
||||
public static float SizeSmall => SpineSizeSmall?.Value ?? SvermConfig.SpineSizeSmall;
|
||||
public static float SizeFull => SpineSizeFull?.Value ?? SvermConfig.SpineSizeFull;
|
||||
/// <summary>
|
||||
/// The bone name, never blank.
|
||||
///
|
||||
/// An empty string is not "no preference": FindBone's loose match asks whether a bone's
|
||||
/// name CONTAINS the wanted string, and every string contains the empty one - so a blank
|
||||
/// entry silently mounted the crest on the first bone of the armature. Clearing the field
|
||||
/// while experimenting is an obvious thing to do, so it has to mean "the default".
|
||||
/// </summary>
|
||||
public static string Bone
|
||||
{
|
||||
get
|
||||
{
|
||||
string configured = SpineBoneName?.Value;
|
||||
return string.IsNullOrWhiteSpace(configured) ? SvermConfig.SpineBoneName : configured;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue