Skip to content

Commit

Permalink
Merge pull request #31 from jecrell/dev
Browse files Browse the repository at this point in the history
Version change
  • Loading branch information
jecrell authored Oct 28, 2022
2 parents 85f7828 + d53dd84 commit 9c83bf2
Show file tree
Hide file tree
Showing 19 changed files with 76 additions and 67 deletions.
Binary file modified 1.4/Assemblies/0JecsTools.dll
Binary file not shown.
Binary file modified 1.4/Assemblies/AbilityUser.dll
Binary file not shown.
Binary file modified 1.4/Assemblies/AbilityUserAI.dll
Binary file not shown.
Binary file modified 1.4/Assemblies/CompActivatableEffect.dll
Binary file not shown.
Binary file modified 1.4/Assemblies/CompAnimated.dll
Binary file not shown.
Binary file modified 1.4/Assemblies/CompBigBox.dll
Binary file not shown.
Binary file modified 1.4/Assemblies/CompDelayedSpawner.dll
Binary file not shown.
Binary file modified 1.4/Assemblies/CompInstalledPart.dll
Binary file not shown.
Binary file modified 1.4/Assemblies/CompOversizedWeapon.dll
Binary file not shown.
Binary file modified 1.4/Assemblies/CompSlotLoadable.dll
Binary file not shown.
12 changes: 10 additions & 2 deletions About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<downloadUrl>https://github.com/pardeike/HarmonyRimWorld/releases/latest</downloadUrl>
</li>
</modDependencies>
<description>1.4.0.0 (10-21-2022)
<description>1.4.1.1 (10-28-2022)

Adds modding components to RimWorld: vehicles, spell casting, weapon slots, oversized weapons, and more!

Expand Down Expand Up @@ -71,11 +71,19 @@ Improvements by lbmaian
Thank you to my Patrons for supporting me in my efforts. Without you, none of this would be possible.

These are the most excellent rim dwellers who support me:
Michael Fisher, Storm D Bain, Luke Salinas, WonkyWoo WeebHoo, Daniel Schott, RainerWingel , Lea Stannard, David Silberstein, Matt Harris, Kiya Nicoll, Paul Fenwick, Elodie , Genaeve , David Turner, Populous25 , Matthew Isom, Charlie Garnham, TinyATuin, Michael Cailler, Jimes Tooper, Landon Cash, Sharp Spook, Don Homer, roxxploxx , Alex Mederer, Justin Andres, Dan Jones, Kaz, Michael Whitehead, iknowdude00, Alexander , Ken Birdwell, Michael Fisher, Storm D Bain, Luke Salinas, WonkyWoo WeebHoo, Daniel Schott, RainerWingel , Lea Stannard, David Silberstein, Matt Harris, Kiya Nicoll, Paul Fenwick, Elodie , Genaeve , David Turner, Populous25 , Matthew Isom, Charlie Garnham, TinyATuin, Michael Cailler, Jimes Tooper, Landon Cash, Sharp Spook, Don Homer, roxxploxx , Alex Mederer, Justin Andres, Dan Jones, Kaz, Michael Whitehead, iknowdude00, Alexander , Ken Birdwell
Darcilyn Lynds (darci.andel), Luke Salinas, RainerWingel , Noisy Koi, Lea Stannard, David Silberstein, Matt Harris, Kiya Nicoll, Paul Fenwick, Genaeve , Populous25 , David Turner, TinyATuin, Michael Cailler, Jimes Tooper, Sharp Spook, Don Homer, roxxploxx , Alex Mederer, Dan Jones, Michael Whitehead, iknowdude00, Kaz, Alexander , Ken Birdwell, Darcilyn Lynds (darci.andel), Luke Salinas, RainerWingel , Noisy Koi, Lea Stannard, David Silberstein, Matt Harris, Kiya Nicoll, Paul Fenwick, Genaeve , Populous25 , David Turner, TinyATuin, Michael Cailler, Jimes Tooper, Sharp Spook, Don Homer, roxxploxx , Alex Mederer, Dan Jones, Michael Whitehead, iknowdude00, Kaz, Alexander , Ken Birdwell

========================
Changelog
========================
1.4.1.1 (10-28-2022)
========================
Added xenotype boolean for PawnkindGeneExtension. Code housekeeping done as well

1.4.1.0 (10-27-2022)
========================
Modders can now give PawnKindDefs random chances for genetics using JecsTools.PawnKindGeneExtension on PawnKindDefs under modExtensions

1.4.0.0 (10-21-2022)
========================
Initial update for RimWorld 1.4 of JecsTools
Expand Down
8 changes: 8 additions & 0 deletions About/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
1.4.1.1 (10-28-2022)
========================
Added xenotype boolean for PawnkindGeneExtension. Code housekeeping done as well

1.4.1.0 (10-27-2022)
========================
Modders can now give PawnKindDefs random chances for genetics using JecsTools.PawnKindGeneExtension on PawnKindDefs under modExtensions

1.4.0.0 (10-21-2022)
========================
Initial update for RimWorld 1.4 of JecsTools
Expand Down
2 changes: 1 addition & 1 deletion About/Manifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>JecsTools</identifier>
<version>1.4.0.0</version>
<version>1.4.1.1</version>
<dependencies />
<incompatibleWith />
<manifestUri>https://raw.githubusercontent.com/jecrell/JecsTools/master/About/Manifest.xml</manifestUri>
Expand Down
2 changes: 1 addition & 1 deletion About/Version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.0.0
1.4.1.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using HarmonyLib;
using RimWorld;
using UnityEngine;
using Verse;

namespace JecsTools;

public static partial class HarmonyPatches
{
public static void HarmonyPatches_StartWithGenes(Harmony harmony, Type type)
{
//Allows for adding additional genes when characters spawn with the PawnKindGeneExtension modExtension
harmony.Patch(AccessTools.Method(typeof(PawnGenerator), nameof(PawnGenerator.GeneratePawn),
new[] { typeof(PawnGenerationRequest) }),
postfix: new HarmonyMethod(type, nameof(Post_GeneratePawn_Genes)));
}

public static void Post_GeneratePawn_Genes(Pawn __result)
{
if (!ModsConfig.BiotechActive)
return;

var pawnKindGeneExtension = __result?.kindDef.GetPawnKindGeneExtension();
if (pawnKindGeneExtension == null)
return;

foreach (var gene in pawnKindGeneExtension.Genes.Where(gene => Rand.Range(min: 0, max: 100) < gene.chance))
{
__result.genes.AddGene(DefDatabase<GeneDef>.GetNamed(gene.defName), gene.xenogene);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace JecsTools
public class ChancedGeneEntry
{
public string defName;
public bool xenogene = false;
public float chance = 100;
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,19 @@ public static ApparelExtension GetApparelExtension(this Def def)
}
return null;
}


public static PawnKindGeneExtension GetPawnKindGeneExtension(this Def def)
{
var modExtensions = def.modExtensions;
if (modExtensions == null)
return null;
for (int i = 0, count = modExtensions.Count; i < count; i++)
{
if (modExtensions[i] is PawnKindGeneExtension modExtension)
return modExtension;
}
return null;
}
}
}
10 changes: 5 additions & 5 deletions updateinfo
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
==============================

JecsTools Update
v1.4.0.0 (10-21-2022)
v1.4.1.0 (10-27-2022)
====================

Initial update for RimWorld 1.4 of JecsTools
Modders can now give PawnKindDefs random chances for genetics using JecsTools.PawnKindGeneExtension on PawnKindDefs under modExtensions
--------------------

Download now on...
Expand All @@ -25,9 +25,9 @@ Discuss the mod on...
[img width=260]https://raw.githubusercontent.com/jecrell/JecsTools/master/About/Preview.png[/img]
[hr]
[b]JecsTools
Version: 1.4.0.0
Updated: 10-21-2022
Description: [color=orange]Initial update for RimWorld 1.4 of JecsTools[/color]
Version: 1.4.1.0
Updated: 10-27-2022
Description: [color=orange]Modders can now give PawnKindDefs random chances for genetics using JecsTools.PawnKindGeneExtension on PawnKindDefs under modExtensions[/color]
[hr]
[b]Download now on...[/b]
[url=https://www.patreon.com/posts/73617775]Patreon[/url]
Expand Down

0 comments on commit 9c83bf2

Please sign in to comment.