Skip to content

Commit

Permalink
v1.05
Browse files Browse the repository at this point in the history
  • Loading branch information
juanosarg committed Feb 3, 2025
1 parent a9e4b39 commit 72af10a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
Binary file modified 1.5/Assemblies/VSE.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ public static Passion ChooseIncrementedPassion(Passion passion)

public static void AddRandomBadPassion(List<SkillDef> skills, ChoiceLetter_GrowthMoment __instance)
{
if (Rand.Chance(0.05f))
if (Rand.Chance(SkillsMod.Settings.GrowthMomentRandomPassionsChance/100))
{

Pawn pawn = __instance.pawn;
if (pawn.ageTracker.AgeBiologicalYears <= 13)
{
Expand All @@ -79,12 +80,13 @@ public static void AddRandomBadPassion(List<SkillDef> skills, ChoiceLetter_Growt
.RandomElementByWeight(def => def.commonality);


foreach (SkillDef skillChosen in skills.InRandomOrder())
foreach (SkillRecord skill in pawn.skills.skills.InRandomOrder())
{
SkillRecord skill = pawn.skills.GetSkill(skillChosen);

if (skill.passion == Passion.None)
{
skill.passion = (Passion)passion.index;

return;
}
}
Expand Down
6 changes: 6 additions & 0 deletions 1.5/Source/VSE/SkillsMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public override void DoSettingsWindowContents(Rect inRect)
listing.LabelPlus("VSE.StatMultiplier".Translate() + ": " + Settings.StatMultiplier, "VSE.StatMultiplierDesc".Translate());
Settings.StatMultiplier = (float)Math.Round(listing.Slider(Settings.StatMultiplier, 0.1f, 5f), 1);

listing.LabelPlus("VSE.GrowthMomentRandomPassions".Translate() + ": " + Settings.GrowthMomentRandomPassionsChance, "VSE.GrowthMomentRandomPassionsDesc".Translate());
Settings.GrowthMomentRandomPassionsChance = (float)Math.Round(listing.Slider(Settings.GrowthMomentRandomPassionsChance, 1f, 100f), 0);


var height = Text.LineHeight * (DefDatabase<PassionDef>.DefCount + 2) + 50f;
var inner = listing.BeginSection(height);
Expand Down Expand Up @@ -113,6 +116,7 @@ public class SkillsModSettings : ModSettings
public int MaxExpertise = 1;
public int LevelToGetExpertise = 15;
public float StatMultiplier = 1;
public float GrowthMomentRandomPassionsChance = 5;

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

Expand All @@ -127,6 +131,8 @@ public override void ExposeData()
Scribe_Values.Look(ref AllowExpertiseOverlap, "allowExpertiseOverlap", true);
Scribe_Values.Look(ref LevelToGetExpertise, "LevelToGetExpertise", 15);
Scribe_Values.Look(ref StatMultiplier, "StatMultiplier", 1);
Scribe_Values.Look(ref GrowthMomentRandomPassionsChance, "GrowthMomentRandomPassionsChance", 5);


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 @@ -54,5 +54,7 @@
<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>
<VSE.GrowthMomentRandomPassions>Random passion chance in growth moments</VSE.GrowthMomentRandomPassions>
<VSE.GrowthMomentRandomPassionsDesc>By default, 5% of the time a growth moment will select one of the skills that have no passions and assign either a Natural or an Apathy passion.</VSE.GrowthMomentRandomPassionsDesc>
<VSE_Passion>Passion: {0}</VSE_Passion>
</LanguageData>

0 comments on commit 72af10a

Please sign in to comment.