Skip to content

Commit

Permalink
v1.02
Browse files Browse the repository at this point in the history
  • Loading branch information
juanosarg committed Jan 6, 2025
1 parent 725a857 commit 9982456
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
Binary file modified 1.5/Assemblies/VSE.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions 1.5/Source/VSE/Expertise/ExpertiseDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public string Effects(int level = 0, string prefix = "") =>
statFactors.Aggregate("",
(current, factor) =>
current +
$"\n{prefix}{factor.stat.LabelCap}: {factor.stat.Worker.ValueToString(1 + factor.value * level, false, ToStringNumberSense.Factor)}"),
$"\n{prefix}{factor.stat.LabelCap}: {factor.stat.Worker.ValueToString(1 + factor.value * level *SkillsMod.Settings.StatMultiplier, false, ToStringNumberSense.Factor)}"),
(current, offset) =>
current +
$"\n{prefix}{offset.stat.LabelCap}: {offset.stat.Worker.ValueToString(offset.value * level, false, ToStringNumberSense.Offset)}");
$"\n{prefix}{offset.stat.LabelCap}: {offset.stat.Worker.ValueToString(offset.value * level * SkillsMod.Settings.StatMultiplier, false, ToStringNumberSense.Offset)}");
}
8 changes: 4 additions & 4 deletions 1.5/Source/VSE/Expertise/ExpertiseTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void OffsetStat(StatDef stat, ref float value)
for (var i = 0; i < expertise.Count; i++)
{
var expertiseRecord = expertise[i];
value += expertiseRecord.def.statOffsets.GetStatOffsetFromList(stat) * expertiseRecord.Level;
value += expertiseRecord.def.statOffsets.GetStatOffsetFromList(stat) * expertiseRecord.Level * SkillsMod.Settings.StatMultiplier;
}
}

Expand All @@ -54,7 +54,7 @@ public void OffsetStatExplain(StatDef stat, StringBuilder builder)
if (offset != 0f)
{
builder.AppendLine(
$" {expertiseRecord.def.LabelCap} ({expertiseRecord.Level}): {stat.Worker.ValueToString(offset * expertiseRecord.Level, false, ToStringNumberSense.Offset)}");
$" {expertiseRecord.def.LabelCap} ({expertiseRecord.Level}): {stat.Worker.ValueToString(offset * expertiseRecord.Level * SkillsMod.Settings.StatMultiplier, false, ToStringNumberSense.Offset)}");
addedAnything = true;
}
}
Expand All @@ -73,7 +73,7 @@ public void MultiplyStatExplain(StatDef stat, StringBuilder builder)
if (factorOffset != 0f)
{
builder.AppendLine(
$" {expertiseRecord.def.LabelCap} ({expertiseRecord.Level}): {stat.Worker.ValueToString(1f + factorOffset * expertiseRecord.Level, false, ToStringNumberSense.Factor)}");
$" {expertiseRecord.def.LabelCap} ({expertiseRecord.Level}): {stat.Worker.ValueToString(1f + factorOffset * expertiseRecord.Level * SkillsMod.Settings.StatMultiplier, false, ToStringNumberSense.Factor)}");
addedAnything = true;
}
}
Expand All @@ -87,7 +87,7 @@ public void MultiplyStat(StatDef stat, ref float value)
{
var expertiseRecord = expertise[i];
var factor = expertiseRecord.def.statFactors.GetStatValueFromList(stat, 0f);
if (factor != 0f) value *= 1f + factor * expertiseRecord.Level;
if (factor != 0f) value *= 1f + factor * expertiseRecord.Level * SkillsMod.Settings.StatMultiplier;
}
}
}
8 changes: 7 additions & 1 deletion 1.5/Source/VSE/SkillsMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ public override void DoSettingsWindowContents(Rect inRect)
listing.LabelPlus("VSE.MinSkillForExpertise".Translate() + ": " + Settings.LevelToGetExpertise, "VSE.MinSkillForExpertiseDesc".Translate());
Settings.LevelToGetExpertise = (int)Math.Round(listing.Slider(Settings.LevelToGetExpertise, 1f, 20f), 1);


listing.LabelPlus("VSE.StatMultiplier".Translate() + ": " + Settings.StatMultiplier, "VSE.StatMultiplierDesc".Translate());
Settings.StatMultiplier = (float)Math.Round(listing.Slider(Settings.StatMultiplier, 0.1f, 5f), 1);


var height = Text.LineHeight * (DefDatabase<PassionDef>.DefCount + 2) + 50f;
var inner = listing.BeginSection(height);
if (inner.ButtonTextLabeled("VSE.Commonalities".Translate(), "VSE.Reset".Translate())) Settings.PassionCommonalities.Clear();
Expand Down Expand Up @@ -109,6 +112,7 @@ public class SkillsModSettings : ModSettings
public bool EnableSkillLoss;
public int MaxExpertise = 1;
public int LevelToGetExpertise = 15;
public float StatMultiplier = 1;

public Dictionary<string, float> PassionCommonalities = new();

Expand All @@ -122,6 +126,8 @@ public override void ExposeData()
Scribe_Values.Look(ref EnableAlert, "enableAlert", true);
Scribe_Values.Look(ref AllowExpertiseOverlap, "allowExpertiseOverlap", true);
Scribe_Values.Look(ref LevelToGetExpertise, "LevelToGetExpertise", 15);
Scribe_Values.Look(ref StatMultiplier, "StatMultiplier", 1);

Scribe_Collections.Look(ref PassionCommonalities, "passionCommonalities", LookMode.Value, LookMode.Value);
PassionCommonalities ??= new Dictionary<string, float>();
}
Expand Down
2 changes: 2 additions & 0 deletions Languages/English/Keyed/Misc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@
<VSE.EnableSkillsLoss.Desc>By default, Ducks' Insane Skills disables all skill loss. By selecting this option, this mod will override Ducks and enable it again. Use this if you still want to be able to take advantage of the forget speed changes in the new passions.</VSE.EnableSkillsLoss.Desc>
<VSE.MinSkillForExpertise>Minimum skill to get an expertise</VSE.MinSkillForExpertise>
<VSE.MinSkillForExpertiseDesc>The colonist will need to reach this skill level before being offered an expertise.</VSE.MinSkillForExpertiseDesc>
<VSE.StatMultiplier>Expertise stat factor / offset multiplier</VSE.StatMultiplier>
<VSE.StatMultiplierDesc>Is our balance too easy? Too hard? Go bitch on Reddit! Errrr... I mean, change it with this slider! The effects expertise have on stats will be multiplied by this number, so 0.1 will make expertise super weak, while 5 will make them incredibly overpowered.</VSE.StatMultiplierDesc>
</LanguageData>

0 comments on commit 9982456

Please sign in to comment.