commit fcee1efef3a07adaab17097ff317c3c25f6b64ba Author: Vegapnk Date: Sun Nov 13 18:37:40 2022 +0100 Initial Commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bd55167 --- /dev/null +++ b/.gitignore @@ -0,0 +1,256 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +#*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc \ No newline at end of file diff --git a/About/About.xml b/About/About.xml new file mode 100644 index 0000000..a414d20 --- /dev/null +++ b/About/About.xml @@ -0,0 +1,39 @@ + + RJW Genes + Vegapnk + Vegapnk.rjw.genes + +
  • 1.4
  • +
    + Adds Genes for RJW Content + https://steamcommunity.com/id/Vegapnk/myworkshopfiles/?appid=294100 + +
  • + rim.job.world + RimJobWorld + https://www.loverslab.com/files/file/7257-rimjobworld/ +
  • + +
    + +
  • rim.job.world
  • + +
    + +
    \ No newline at end of file diff --git a/About/Preview.png b/About/Preview.png new file mode 100644 index 0000000..315ad3c Binary files /dev/null and b/About/Preview.png differ diff --git a/Common/Assemblies/0MultiplayerAPI.dll b/Common/Assemblies/0MultiplayerAPI.dll new file mode 100644 index 0000000..38b8a0e Binary files /dev/null and b/Common/Assemblies/0MultiplayerAPI.dll differ diff --git a/Common/Assemblies/RJW.dll b/Common/Assemblies/RJW.dll new file mode 100644 index 0000000..7a61125 Binary files /dev/null and b/Common/Assemblies/RJW.dll differ diff --git a/Common/Assemblies/Rjw-Genes.dll b/Common/Assemblies/Rjw-Genes.dll new file mode 100644 index 0000000..b5b908f Binary files /dev/null and b/Common/Assemblies/Rjw-Genes.dll differ diff --git a/Common/Defs/Genes/GeneCategories.xml b/Common/Defs/Genes/GeneCategories.xml new file mode 100644 index 0000000..e9b727b --- /dev/null +++ b/Common/Defs/Genes/GeneCategories.xml @@ -0,0 +1,10 @@ + + + + + rjw_genes_genitalia + + 541 + + + \ No newline at end of file diff --git a/Common/Defs/Genes/GeneDefs_GenitaliaEndogenes.xml b/Common/Defs/Genes/GeneDefs_GenitaliaEndogenes.xml new file mode 100644 index 0000000..c4f40d0 --- /dev/null +++ b/Common/Defs/Genes/GeneDefs_GenitaliaEndogenes.xml @@ -0,0 +1,87 @@ + + + + + rjw_genes_genitalia + +
  • GenitalType
  • +
    + +
    + + + rjw_genes_human_genitalia + + Carriers of this carry genitalia similar to humans. + Genes/Icons/Placeholder + RJW_Genes.Gene_HumanGenitalia + 1 + + + + rjw_genes_equine_genitalia + + Carriers of this gene develop equine genitalia. + Genes/Icons/Placeholder + RJW_Genes.Gene_EquineGenitalia + 2 + + + + rjw_genes_canine_genitalia + + Carriers of this gene develop canine genitalia. + Genes/Icons/Placeholder + RJW_Genes.Gene_CanineGenitalia + 3 + + + + rjw_genes_feline_genitalia + + Carriers of this gene develop feline genitalia. + Genes/Icons/Placeholder + RJW_Genes.Gene_FelineGenitalia + 4 + + + + rjw_genes_demonic_genitalia + + Carriers of this gene have demonic genitalia. + Genes/Icons/Placeholder + RJW_Genes.Gene_DemonicGenitalia + 5 + + + + rjw_genes_dragon_genitalia + + Carriers of this gene develop dragon genitalia. + Genes/Icons/Placeholder + RJW_Genes.Gene_DragonGenitalia + 6 + + + + rjw_genes_slime_genitalia + + Carriers of this gene have slime genitalia. + Genes/Icons/Placeholder + RJW_Genes.Gene_SlimeGenitalia + 7 + + + + rjw_genes_ovipositor_genitalia + + Carriers of this gene have ovipositors similar to insects. + Genes/Icons/Placeholder + RJW_Genes.Gene_OvipositorGenitalia + 8 + + +
    \ No newline at end of file diff --git a/Common/Patches/Xenotypes/GenitaliaUpdate.xml b/Common/Patches/Xenotypes/GenitaliaUpdate.xml new file mode 100644 index 0000000..aa225d6 --- /dev/null +++ b/Common/Patches/Xenotypes/GenitaliaUpdate.xml @@ -0,0 +1,155 @@ + + + + + + + + Always + +
  • + Defs/XenotypeDef[defName="Baseline"] + + +
  • rjw_genes_human_genitalia
  • + + + +
    +
    + + + Always + +
  • + Defs/XenotypeDef[defName="Dirtmole"]/genes + +
  • rjw_genes_human_genitalia
  • + + +
    +
    + + + Always + +
  • + Defs/XenotypeDef[defName="Hussar"]/genes + +
  • rjw_genes_human_genitalia
  • + + +
    +
    + + + Always + +
  • + Defs/XenotypeDef[defName="Neanderthal"]/genes + +
  • rjw_genes_human_genitalia
  • + + +
    +
    + + + Always + +
  • + Defs/XenotypeDef[defName="Pigskin"]/genes + +
  • rjw_genes_human_genitalia
  • + + +
    +
    + + + Always + +
  • + Defs/XenotypeDef[defName="Waster"]/genes + +
  • rjw_genes_human_genitalia
  • + + +
    +
    + + + Always + +
  • + Defs/XenotypeDef[defName="Yttakin"]/genes + +
  • rjw_genes_human_genitalia
  • + + +
    +
    + + + Always + +
  • + Defs/XenotypeDef[defName="Highmate"]/genes + +
  • rjw_genes_human_genitalia
  • + + +
    +
    + + + + + Always + +
  • + Defs/XenotypeDef[defName="Baseline"]/genes + +
  • rjw_genes_human_genitalia
  • + + +
    +
    + + + Always + +
  • + Defs/XenotypeDef[defName="Sanguophage"]/genes + +
  • rjw_genes_demonic_genitalia
  • + + +
    +
    + + + Always + +
  • + Defs/XenotypeDef[defName="Genie"]/genes + +
  • rjw_genes_slime_genitalia
  • + + +
    +
    + + + Always + +
  • + Defs/XenotypeDef[defName="Impid"]/genes + +
  • rjw_genes_demonic_genitalia
  • + + +
    +
    + +
    diff --git a/Common/Textures/Genes/Icons/Placeholder.png b/Common/Textures/Genes/Icons/Placeholder.png new file mode 100644 index 0000000..9b73621 Binary files /dev/null and b/Common/Textures/Genes/Icons/Placeholder.png differ diff --git a/Rjw-Genes.sln b/Rjw-Genes.sln new file mode 100644 index 0000000..858f9a2 --- /dev/null +++ b/Rjw-Genes.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32014.148 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rjw-Genes", "Source\Rjw-Genes.csproj", "{D7D21B4A-1DA7-41D8-B202-C58CA8FA62AA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D7D21B4A-1DA7-41D8-B202-C58CA8FA62AA}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {D7D21B4A-1DA7-41D8-B202-C58CA8FA62AA}.Debug|Any CPU.Build.0 = Release|Any CPU + {D7D21B4A-1DA7-41D8-B202-C58CA8FA62AA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D7D21B4A-1DA7-41D8-B202-C58CA8FA62AA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {28CF9A73-5333-4EB3-BFCC-3FBEDDA19200} + EndGlobalSection +EndGlobal diff --git a/Rjw-genes-test/GenitaliaChangerUnitTests.cs b/Rjw-genes-test/GenitaliaChangerUnitTests.cs new file mode 100644 index 0000000..e8942ea --- /dev/null +++ b/Rjw-genes-test/GenitaliaChangerUnitTests.cs @@ -0,0 +1,17 @@ +using Xunit; + + +using RJW_Genes; +using Verse; + +namespace Rjw_genes_test +{ + public class GenitaliaChangerUnitTests + { + [Fact] + public void TestChangeGenitalia() + { + Pawn example = Verse.PawnGenerator.GeneratePawn(new PawnGenerationRequest()); + } + } +} \ No newline at end of file diff --git a/Rjw-genes-test/Rjw-genes-test.csproj b/Rjw-genes-test/Rjw-genes-test.csproj new file mode 100644 index 0000000..f3f66c5 --- /dev/null +++ b/Rjw-genes-test/Rjw-genes-test.csproj @@ -0,0 +1,34 @@ + + + + net6.0 + Rjw_genes_test + enable + + false + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + ..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll + + + + diff --git a/Source/GeneDefOf.cs b/Source/GeneDefOf.cs new file mode 100644 index 0000000..0758245 --- /dev/null +++ b/Source/GeneDefOf.cs @@ -0,0 +1,20 @@ +using RimWorld; +using Verse; + +namespace RJW_Genes +{ + [DefOf] + public static class GeneDefOf + { + [MayRequireBiotech] public static readonly GeneCategoryDef rjw_genes_genitalia; + + [MayRequireBiotech] public static readonly GeneDef rjw_genes_human_genitalia; + [MayRequireBiotech] public static readonly GeneDef rjw_genes_equine_genitalia; + [MayRequireBiotech] public static readonly GeneDef rjw_genes_demonic_genitalia; + [MayRequireBiotech] public static readonly GeneDef rjw_genes_dragon_genitalia; + [MayRequireBiotech] public static readonly GeneDef rjw_genes_slime_genitalia; + [MayRequireBiotech] public static readonly GeneDef rjw_genes_ovipositor_genitalia; + [MayRequireBiotech] public static readonly GeneDef rjw_genes_feline_genitalia; + [MayRequireBiotech] public static readonly GeneDef rjw_genes_canine_genitalia; + } +} diff --git a/Source/Genes/Genitalia/Gene_CanineGenitalia.cs b/Source/Genes/Genitalia/Gene_CanineGenitalia.cs new file mode 100644 index 0000000..5a9389d --- /dev/null +++ b/Source/Genes/Genitalia/Gene_CanineGenitalia.cs @@ -0,0 +1,22 @@ +using Verse; +using rjw; + +namespace RJW_Genes +{ + public class Gene_CanineGenitalia : Gene + { + public override void PostMake() + { + base.PostMake(); + Sexualizer.sexualize_pawn(pawn); + GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.canine_penis,Genital_Helper.canine_vagina,Genital_Helper.generic_anus); + } + + public override void PostAdd() + { + base.PostMake(); + GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.canine_penis, Genital_Helper.canine_vagina, Genital_Helper.generic_anus); + } + } + +} diff --git a/Source/Genes/Genitalia/Gene_DemonicGenitalia.cs b/Source/Genes/Genitalia/Gene_DemonicGenitalia.cs new file mode 100644 index 0000000..2f1b3a9 --- /dev/null +++ b/Source/Genes/Genitalia/Gene_DemonicGenitalia.cs @@ -0,0 +1,23 @@ +using Verse; +using RimWorld; +using rjw; + +namespace RJW_Genes +{ + public class Gene_DemonicGenitalia : Gene + { + public override void PostMake() + { + base.PostMake(); + Sexualizer.sexualize_pawn(pawn); + GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.demon_penis,Genital_Helper.demon_vagina,Genital_Helper.demon_anus); + } + + public override void PostAdd() + { + base.PostMake(); + GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.demon_penis, Genital_Helper.demon_vagina, Genital_Helper.demon_anus); + } + } + +} diff --git a/Source/Genes/Genitalia/Gene_DragonGenitalia.cs b/Source/Genes/Genitalia/Gene_DragonGenitalia.cs new file mode 100644 index 0000000..05f3aaf --- /dev/null +++ b/Source/Genes/Genitalia/Gene_DragonGenitalia.cs @@ -0,0 +1,22 @@ +using Verse; +using rjw; + +namespace RJW_Genes +{ + public class Gene_DragonGenitalia : Gene + { + public override void PostMake() + { + base.PostMake(); + Sexualizer.sexualize_pawn(pawn); + GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.dragon_penis,Genital_Helper.dragon_vagina,Genital_Helper.generic_anus); + } + + public override void PostAdd() + { + base.PostMake(); + GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.dragon_penis, Genital_Helper.dragon_vagina, Genital_Helper.generic_anus); + } + } + +} diff --git a/Source/Genes/Genitalia/Gene_EquineGenitalia.cs b/Source/Genes/Genitalia/Gene_EquineGenitalia.cs new file mode 100644 index 0000000..03aa029 --- /dev/null +++ b/Source/Genes/Genitalia/Gene_EquineGenitalia.cs @@ -0,0 +1,22 @@ +using Verse; +using rjw; + +namespace RJW_Genes +{ + public class Gene_EquineGenitalia : Gene + { + public override void PostMake() + { + base.PostMake(); + Sexualizer.sexualize_pawn(pawn); + GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.equine_penis,Genital_Helper.equine_vagina,Genital_Helper.generic_anus); + } + + public override void PostAdd() + { + base.PostMake(); + GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.equine_penis, Genital_Helper.equine_vagina, Genital_Helper.generic_anus); + } + } + +} diff --git a/Source/Genes/Genitalia/Gene_FelineGenitalia.cs b/Source/Genes/Genitalia/Gene_FelineGenitalia.cs new file mode 100644 index 0000000..910951d --- /dev/null +++ b/Source/Genes/Genitalia/Gene_FelineGenitalia.cs @@ -0,0 +1,22 @@ +using Verse; +using rjw; + +namespace RJW_Genes +{ + public class Gene_FelineGenitalia : Gene + { + public override void PostMake() + { + base.PostMake(); + Sexualizer.sexualize_pawn(pawn); + GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.feline_penis,Genital_Helper.feline_vagina,Genital_Helper.generic_anus); + } + + public override void PostAdd() + { + base.PostMake(); + GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.feline_penis, Genital_Helper.feline_vagina, Genital_Helper.generic_anus); + } + } + +} diff --git a/Source/Genes/Genitalia/Gene_HumanGenitalia.cs b/Source/Genes/Genitalia/Gene_HumanGenitalia.cs new file mode 100644 index 0000000..389bf0a --- /dev/null +++ b/Source/Genes/Genitalia/Gene_HumanGenitalia.cs @@ -0,0 +1,23 @@ +using Verse; +using rjw; + +namespace RJW_Genes +{ + public class Gene_HumanGenitalia : Gene + { + public override void PostMake() + { + base.PostMake(); + Sexualizer.sexualize_pawn(pawn); + GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.average_penis,Genital_Helper.average_vagina,Genital_Helper.average_anus); + } + + public override void PostAdd() + { + base.PostAdd(); + GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.average_penis, Genital_Helper.average_vagina, Genital_Helper.average_anus); + } + + } + +} diff --git a/Source/Genes/Genitalia/Gene_OvipositorGenitalia.cs b/Source/Genes/Genitalia/Gene_OvipositorGenitalia.cs new file mode 100644 index 0000000..2594737 --- /dev/null +++ b/Source/Genes/Genitalia/Gene_OvipositorGenitalia.cs @@ -0,0 +1,22 @@ +using Verse; +using rjw; + +namespace RJW_Genes +{ + public class Gene_OvipositorGenitalia : Gene + { + public override void PostMake() + { + base.PostMake(); + Sexualizer.sexualize_pawn(pawn); + GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.ovipositorM,Genital_Helper.ovipositorF,Genital_Helper.insect_anus); + } + + public override void PostAdd() + { + base.PostMake(); + GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.ovipositorM, Genital_Helper.ovipositorF, Genital_Helper.insect_anus); + } + } + +} diff --git a/Source/Genes/Genitalia/Gene_SlimeGenitalia.cs b/Source/Genes/Genitalia/Gene_SlimeGenitalia.cs new file mode 100644 index 0000000..31b8556 --- /dev/null +++ b/Source/Genes/Genitalia/Gene_SlimeGenitalia.cs @@ -0,0 +1,22 @@ +using Verse; +using rjw; + +namespace RJW_Genes +{ + public class Gene_SlimeGenitalia : Gene + { + public override void PostMake() + { + base.PostMake(); + Sexualizer.sexualize_pawn(pawn); + GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.slime_penis,Genital_Helper.slime_vagina,Genital_Helper.slime_anus); + } + + public override void PostAdd() + { + base.PostMake(); + GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.slime_penis, Genital_Helper.slime_vagina, Genital_Helper.slime_anus); + } + } + +} diff --git a/Source/Genes/Genitalia/GenitaliaChanger.cs b/Source/Genes/Genitalia/GenitaliaChanger.cs new file mode 100644 index 0000000..6a3f02f --- /dev/null +++ b/Source/Genes/Genitalia/GenitaliaChanger.cs @@ -0,0 +1,94 @@ +using rjw; +using RimWorld; +using Verse; +using System.Collections.Generic; + +namespace RJW_Genes +{ + internal class GenitaliaChanger + { + + /// + /// This method changes the pawns genitalia to the given types of genitalia. + /// All genitals will be changed, e.g. pawns with 2 penises (for whatever reason) or is a futa, all genitals will be changed. + /// Anuses are currently not changed, due to a small bug. + /// + /// the pawn who's genitals will be changed + /// the new type of penis + /// the new type of vagina + /// the new type of anus (currently disabled) + public static void changeGenitalia(Pawn pawn, HediffDef penisReplacement, HediffDef vaginaReplacement, HediffDef anusReplacement) + { + var oldParts = Genital_Helper.get_AllPartsHediffList(pawn); + var partBPR = Genital_Helper.get_genitalsBPR(pawn); + + if (!oldParts.NullOrEmpty()) + { + Hediff replacementGenital; + CompHediffBodyPart CompHediff; + + foreach (Hediff existingGenital in oldParts) + { + if (IsArtificial(existingGenital)) + continue; + + replacementGenital = null; + CompHediff = null; + if (IsPenis(existingGenital)) + replacementGenital = HediffMaker.MakeHediff(penisReplacement, pawn, partBPR); + + if (IsVagina(existingGenital)) + replacementGenital = HediffMaker.MakeHediff(vaginaReplacement, pawn, partBPR); + + //TODO: Adding Anus in this way had an issue by multiplying Anusses. At the moment Anus are not covered. + + if (replacementGenital != null) + { + CompHediff = replacementGenital.TryGetComp(); + if (CompHediff != null) + { + CompHediff.initComp(pawn); + CompHediff.updatesize(); + } + GenderHelper.ChangeSex(pawn, () => + { + pawn.health.RemoveHediff(existingGenital); + pawn.health.AddHediff(replacementGenital, partBPR); + }); + } + } + } + else + { + Messages.Message("RJW_Genes_GenitalsNotAlterable".Translate(pawn), pawn, MessageTypeDefOf.SilentInput); + return; + } + + } + + private static bool IsPenis(Hediff candidate) + { + return + candidate.def.defName.ToLower().Contains("penis") || + candidate.def.defName.ToLower().Contains("ovipositorm") || + candidate.def.defName.ToLower().Contains("tentacle"); + } + + private static bool IsVagina(Hediff candidate) + { + return + candidate.def.defName.ToLower().Contains("vagina") || + candidate.def.defName.ToLower().Contains("ovipositorf"); + } + + private static bool IsAnus(Hediff candidate) + { + return candidate.def.defName.ToLower().Contains("anus"); } + + private static bool IsArtificial(Hediff candidate) + { + return candidate.def.defName.ToLower().Contains("bionic") || candidate.def.defName.ToLower().Contains("archo"); + } + + } +} diff --git a/Source/Properties/AssemblyInfo.cs b/Source/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..00d6216 --- /dev/null +++ b/Source/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Rjw-Genes")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Rjw-Genes")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d7d21b4a-1da7-41d8-b202-c58ca8fa62aa")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Source/RJW_Genes.cs b/Source/RJW_Genes.cs new file mode 100644 index 0000000..c17c779 --- /dev/null +++ b/Source/RJW_Genes.cs @@ -0,0 +1,10 @@ +using Verse; + +namespace BTE_MMLA +{ + [StaticConstructorOnStartup] + public static class RJW_Genes + { + static RJW_Genes() => Log.Message("RJW-Genes loaded"); + } +} diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj new file mode 100644 index 0000000..580fb2f --- /dev/null +++ b/Source/Rjw-Genes.csproj @@ -0,0 +1,62 @@ + + + + + Debug + AnyCPU + {D7D21B4A-1DA7-41D8-B202-C58CA8FA62AA} + Library + Properties + Rjw-Genes + Rjw-Genes + v4.8 + 512 + + + + none + true + ..\Common\Assemblies\ + prompt + 4 + false + + + + ..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll + False + + + ..\..\rjw\1.4\Assemblies\RJW.dll + + + + + + + + + ..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll + False + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file