diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8dd4607 --- /dev/null +++ b/.gitignore @@ -0,0 +1,398 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.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 + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# 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 +# Note: 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 +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable 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 +*.appx +*.appxbundle +*.appxupload + +# 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 +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# 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 +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# 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/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml \ No newline at end of file diff --git a/1.4/Assemblies/RJW-Quirks.dll b/1.4/Assemblies/RJW-Quirks.dll new file mode 100644 index 0000000..0d790aa Binary files /dev/null and b/1.4/Assemblies/RJW-Quirks.dll differ diff --git a/1.4/Defs/QuirkDefs/QuirkDef.xml b/1.4/Defs/QuirkDefs/QuirkDef.xml new file mode 100644 index 0000000..ac2ac01 --- /dev/null +++ b/1.4/Defs/QuirkDefs/QuirkDef.xml @@ -0,0 +1,116 @@ + + + + + Breeder + + {pawn} has given birth so many times that {pawn_possessive} body has adapted to breeding. {pawn_possessive} pregnancies are shorter and produce more offspring. + ForcedOnly + true + +
  • + RecordChanged + CountOfBirthHuman + 10 +
  • +
  • + RecordChanged + CountOfBirthAnimal + 20 +
  • +
  • + maxLitterOnBirth + 2.0 +
  • +
    +
    + + + Fertile + + {pawn} has unusually high fertility and so is more likely to have children. + +
  • Infertile
  • +
    + +
  • + + RaceHasNoFertility +
  • +
    + +
  • + QuirkAddedTo + IncreasedFertility +
  • +
  • + QuirkRemovedFrom + IncreasedFertility +
  • +
    +
    + + + Incubator + + {pawn} has birthed so many eggs that {pawn_possessive} body has adapted to handling them. {pawn_possessive} egg incubation speed has increased. + ForcedOnly + true + +
  • + RecordChanged + CountOfBirthEgg + 100 +
  • +
  • + maxEggsSize + 2.0 +
  • +
  • + maxLitterOnBirth + 2.0 +
  • +
    +
    + + + Infertile + + {pawn} has unusually low fertility and so is unlikely to have children. + +
  • Fertile
  • +
    + +
  • + + RaceHasNoFertility +
  • +
    + +
  • + QuirkAddedTo + DecreasedFertility +
  • +
  • + QuirkRemovedFrom + DecreasedFertility +
  • +
    +
    + + + Messy + + {pawn} not only produces copious amounts of fluid during sex but {pawn_pronoun} rarely bothers to clean {pawn_possessive}self afterwards. + +
  • + cumFilthAmount + 2.0 +
  • +
  • + cleanAfterFapChance + -0.75 +
  • +
    +
    +
    \ No newline at end of file diff --git a/1.4/Defs/QuirkDefs/QuirkDef_Humanlike.xml b/1.4/Defs/QuirkDefs/QuirkDef_Humanlike.xml new file mode 100644 index 0000000..222ecd3 --- /dev/null +++ b/1.4/Defs/QuirkDefs/QuirkDef_Humanlike.xml @@ -0,0 +1,268 @@ + + + + + +
  • + + NotHumanlike +
  • +
    +
    + + + Endytophile + + {pawn} prefers to keep {pawn_possessive} clothes on during sex. + + +
  • + Orgasm + ThatsMyFetish +
  • +
    +
    + + + Exhibitionist + + {pawn} enjoys having sex where others can see. + + +
  • + Orgasm + ThatsMyFetish +
  • +
    +
    + + + Gerontophile + + {pawn} prefers older partners (55+ on a human scale). + + 55 + + + +
  • + Orgasm + ThatsMyFetish +
  • +
  • + ageFactor + 1.0 + First +
  • +
    +
    + + + ImpregnationFetish + + {pawn} really likes the idea of someone becoming pregnant. {pawn_pronoun} prefers partners and sex positions where there is a possibility of pregnancy. {pawn_pronoun} doesn't care if {pawn_pronoun} is getting pregnant or {pawn_possessive} partner is as long as babby is formed. + + +
  • +
  • +
    +
    + + +
  • +
  • +
    +
    + +
  • + Orgasm + ThatsMyFetish +
  • +
  • +
  • + RecordChanged + CountOfBirthHuman + 10 + {pawn} has given birth so many times that {pawn_pronoun} developed a fetish for impregnation +
  • +
  • + RecordChanged + CountOfBirthAnimal + 20 + {pawn} has given birth so many times that {pawn_pronoun} developed a fetish for impregnation +
  • +
  • + RecordChanged + CountOfBirthEgg + 100 + {pawn} has birthed so many eggs that {pawn_pronoun} developed a fetish for impregnation +
  • +
  • + bodyFactor + 1.25 +
  • +
    +
    + + + Podophile + + {pawn} really likes feet and prefers foot-related sex acts. + + Footjob + + +
  • + Orgasm + ThatsMyFetish +
  • +
  • + +
  • + Foot + 2.0 +
  • + + +
    +
    + + + PregnancyFetish + + {pawn} prefers partners who are visibly pregnant. + + + +
  • + Orgasm + ThatsMyFetish +
  • +
  • + bodyFactor + 1.25 +
  • +
    +
    + + + Sapiosexual + + {pawn} prefers smart partners. + + +
  • + Transhumanist +
  • +
  • + GreatMemory +
  • +
  • + TooSmart +
  • +
  • + RCT_Savant +
  • +
  • + RCT_Inventor +
  • +
  • + SYR_CreativeThinker +
  • +
  • + Intellectual + 15 +
  • +
    +
    + +
  • + opinionFactor + 1.4 +
  • +
    +
    + + + Somnophile + + {pawn} prefers {pawn_possessive} partners to be asleep. + + + +
  • + Orgasm + ThatsMyFetish +
  • +
  • + bodyFactor + 1.25 +
  • +
    +
    + + + Teratophile + + {pawn} prefers ugly partners. {pawn_pronoun} would also prefer larger and wilder animals if {pawn_pronoun} were into that sort of thing... + + +
  • + CreepyBreathing +
  • +
  • + Beauty + -1 +
  • +
  • + Beauty + -2 +
  • +
  • + Fat +
  • +
  • +
  • + PawnBeauty + -0.1 +
  • +
    +
    + +
  • + bodyFactor + 1.4 + First +
  • + +
  • + wouldFuckAnimalBodySizeMin + 0.8 +
  • +
  • + wouldFuckAnimalBodySizeMax + 2.0 +
  • +
  • + wouldFuckAnimalWildnessModifier + 0.3 +
  • +
    +
    + + + Vigorous + + {pawn} is invigorated by sex. {pawn_pronoun} does not get tired as much during sex. + +
  • + ticksToNextLovin + 0.8 +
  • +
  • + reduceRest + 0.5 +
  • +
    +
    +
    \ No newline at end of file diff --git a/1.4/Defs/QuirkDefs/QuirkDef_RaceTag.xml b/1.4/Defs/QuirkDefs/QuirkDef_RaceTag.xml new file mode 100644 index 0000000..9579cc9 --- /dev/null +++ b/1.4/Defs/QuirkDefs/QuirkDef_RaceTag.xml @@ -0,0 +1,188 @@ + + + + + + + +
  • + Orgasm + ThatsMyFetish +
  • +
    +
    + + + ChitinLover + + {pawn} enjoys the smooth strength of a chitinous exoskeleton. {pawn_pronoun} prefers arachnoid or insectoid partners. + + Chitin + + +
  • + + + + Chitin + + + QuirkForOwnRace +
  • +
    +
    + + + DemonLover + + {pawn} is after the naughty ones. {pawn_pronoun} prefers {pawn_possessive} partners to come from the literal depths of hell, or at least look the part. + + Demon + + +
  • + + + Demon + + + QuirkForOwnRace +
  • +
    +
    + + + FeatherLover + + {pawn} loves that downy fluff. {pawn_pronoun} prefers avian or dinosaur partners. Because dinosaurs are birds and have feathers, as {pawn_pronoun} will explain at great length if given a chance. + + Feathers + + +
  • + + + Feathers + + + QuirkForOwnRace +
  • +
    +
    + + + FurLover + + {pawn} prefers a partner with a thick, luxurious, snuggly-soft coat of fur. + + Fur + + +
  • + + + Fur + + + QuirkForOwnRace +
  • +
    +
    + + + PlantLover + + {pawn} likes watering plants. If you know what I mean. + + Plant + + +
  • + + + Plant + + + QuirkForOwnRace +
  • +
    +
    + + + RobotLover + + Which is better, 2D or 3D? {pawn} knows that 3D-printed gives you the best of both worlds. + + Robot + + +
  • + + + Robot + + + QuirkForOwnRace +
  • +
    +
    + + + ScaleLover + + Who wouldn't want to fuck a dragon? Definitely not {pawn}. {pawn} wants to fuck a dragon. + + Scales + + +
  • + + + Scales + + + QuirkForOwnRace +
  • +
    +
    + + + SkinLover + + {pawn} prefers {pawn_possessive} partners to have smooth sensitive skin without fur or scales getting in the way. Lucky for {pawn_objective} humans are all over the place. + + Skin + + +
  • + + + Skin + + + QuirkForOwnRace +
  • +
    +
    + + + SlimeLover + + Because of their slippery and malleable nature slimes are very, very good at sex. As you will hear over and over if you listen to {pawn} talk for any length of time. + + Slime + + +
  • + + + Slime + + + QuirkForOwnRace +
  • +
    +
    +
    \ No newline at end of file diff --git a/1.4/Defs/RjwEventDefs/RjwEventDef.xml b/1.4/Defs/RjwEventDefs/RjwEventDef.xml new file mode 100644 index 0000000..3018066 --- /dev/null +++ b/1.4/Defs/RjwEventDefs/RjwEventDef.xml @@ -0,0 +1,43 @@ + + + + + + QuirkAddedTo + +
  • Pawn
  • +
  • Quirk
  • +
    +
    + + + QuirkRemovedFrom + +
  • Pawn
  • +
  • Quirk
  • +
    +
    + + + Orgasm + +
  • SexProps
  • +
    +
    + + + RecordChanged + +
  • Pawn
  • +
  • Record
  • +
    +
    + + + PawnSexualized + +
  • Pawn
  • +
    +
    + +
    \ No newline at end of file diff --git a/1.4/Defs/RjwEventHandlerDefs/QuirkHandlers.xml b/1.4/Defs/RjwEventHandlerDefs/QuirkHandlers.xml new file mode 100644 index 0000000..7bb1fc7 --- /dev/null +++ b/1.4/Defs/RjwEventHandlerDefs/QuirkHandlers.xml @@ -0,0 +1,38 @@ + + + + + + Quirk + rjwquirks.Modules.Quirks.EventHandlers.QuirkRjwEventHandler + +
  • QuirkAddedTo
  • +
  • QuirkRemovedFrom
  • +
    +
    + + + QuirkSet + rjwquirks.Modules.Quirks.EventHandlers.QuirkSetRjwEventHandler + +
  • Orgasm
  • +
    +
    + + + QuirkRecordChanged + rjwquirks.Modules.Quirks.EventHandlers.RecordChangedRjwEventHandler + +
  • RecordChanged
  • +
    +
    + + + QuirkGenerator + rjwquirks.Modules.Quirks.EventHandlers.QuirkGenerator + +
  • PawnSexualized
  • +
    +
    + +
    \ No newline at end of file diff --git a/About/About.xml b/About/About.xml new file mode 100644 index 0000000..bd4a5d3 --- /dev/null +++ b/About/About.xml @@ -0,0 +1,34 @@ + + + + RJW Quirks + Rain + + +
  • 1.4
  • +
    + rain.quirks + +
  • + brrainz.harmony + Harmony + steam://url/CommunityFilePage/2009463077 + https://github.com/pardeike/HarmonyRimWorld/releases/latest +
  • +
    + +
  • rim.job.world
  • +
    + +
  • gregorycurrie.AnimalGenetics
  • +
  • EdB.PrepareCarefully
  • +
  • EdB.PrepareCarefully.UnofficialPatch
  • +
  • Dalrae.GaramRaceAddon
  • +
  • IGNI.LostForest
  • +
  • Sierra.RT.MedievalTalents
  • +
  • com.yayo.raceQuestPawn
  • +
    + +big peepee sim + +
    diff --git a/RJW-Quirks/Core.cs b/RJW-Quirks/Core.cs new file mode 100644 index 0000000..a4abaac --- /dev/null +++ b/RJW-Quirks/Core.cs @@ -0,0 +1,18 @@ +using HarmonyLib; +using HugsLib; +using Verse; + +namespace rjwquirks +{ + public class Core : ModBase + { + // Originally did not use Hugslib, but due to RJW using hugslib I needed to in order for proper patching at correct times. could probably be done with priorities or something but this was easier + /*public Core(ModContentPack pack) + { + //var harmony = new Harmony("rain.quirks"); + //harmony.PatchAll(); + }*/ + + public override string ModIdentifier => "quirk"; + } +} diff --git a/RJW-Quirks/Data/RaceTags.cs b/RJW-Quirks/Data/RaceTags.cs new file mode 100644 index 0000000..bd5cde5 --- /dev/null +++ b/RJW-Quirks/Data/RaceTags.cs @@ -0,0 +1,64 @@ +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace rjwquirks.Data +{ + public class RaceTags + { + private readonly static Dictionary tagDatabase = new Dictionary(); + + // I only created tags for RaceGroupDef properties that seemed like keywords (like slime) rather than behavior (like oviPregnancy). + public readonly static RaceTags Chitin = new RaceTags("Chitin"); + public readonly static RaceTags Demon = new RaceTags("Demon"); + public readonly static RaceTags Feathers = new RaceTags("Feathers"); + public readonly static RaceTags Fur = new RaceTags("Fur"); + public readonly static RaceTags Plant = new RaceTags("Plant"); + public readonly static RaceTags Robot = new RaceTags("Robot"); + public readonly static RaceTags Scales = new RaceTags("Scales"); + public readonly static RaceTags Skin = new RaceTags("Skin"); + public readonly static RaceTags Slime = new RaceTags("Slime"); + + + public string Key { get; } + + private RaceTags(string key) + { + Key = key; + tagDatabase.Add(key, this); + } + + public static bool TryParse(string key, out RaceTags raceTag) + { + return tagDatabase.TryGetValue(key, out raceTag); + } + + /// + /// For backwards compatability only. Shouldn't add more special cases here. + /// + public bool DefaultWhenNoRaceGroupDef(Pawn pawn) + { + if (this == Demon) + { + return xxx.is_demon(pawn); + } + else if (this == Slime) + { + return xxx.is_slime(pawn); + } + else if (this == Skin) + { + return true; + } + else + { + return false; + } + } + + } +} diff --git a/RJW-Quirks/HarmonyPatches/Patch_CasualSex_Helper.cs b/RJW-Quirks/HarmonyPatches/Patch_CasualSex_Helper.cs new file mode 100644 index 0000000..57302ae --- /dev/null +++ b/RJW-Quirks/HarmonyPatches/Patch_CasualSex_Helper.cs @@ -0,0 +1,74 @@ +using HarmonyLib; +using RimWorld; +using rjw; +using rjwquirks.Modules.Quirks; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace rjwquirks.HarmonyPatches +{ + [HarmonyPatch(typeof(CasualSex_Helper), nameof(CasualSex_Helper.GetScore))] + public class Patch_CasualSex_Helper + { + // Edits the "score" of a cell for a pawn to fuck in + public static void Postfix(Pawn pawn, IntVec3 cell, Pawn partner, ref int __result) + { + QuirkSet quirks = pawn.GetQuirks(); + + if (quirks.AllQuirks.EnumerableNullOrEmpty()) + return; + + List all_pawns = pawn.Map.mapPawns.AllPawnsSpawned.Where(x + => x.Position.DistanceTo(pawn.Position) < 100 + && xxx.is_human(x) + && x != pawn + && x != partner + ).ToList(); + + // Somnophile code + if (partner != null && quirks.Contains(QuirkDefOf.Somnophile)) + { + if (all_pawns.Any(x + => !x.Awake() + && x.Position.DistanceTo(cell) < 6 + && GenSight.LineOfSight(cell, x.Position, pawn.Map) + )) + __result += 50; + } + + // Exhibitionist code + if (quirks.Contains(QuirkDefOf.Exhibitionist)) + { + bool might_be_seen = CasualSex_Helper.MightBeSeen(all_pawns, cell, pawn, partner); + Room room = cell.GetRoom(pawn.Map); + + // Readd the 30 score removed in regular RJW + __result += 30; + // Readd the 100 score taken from being in a doorway in regular RJW + __result += 100; + + if (might_be_seen) + __result += 5; + else + __result -= 10; + + if (room.Role == RoomRoleDefOf.Barracks || room.Role == RoomRoleDefOf.PrisonBarracks || room.Role == RoomRoleDefOf.PrisonCell + || room.Role == RoomRoleDefOf.Laboratory || room.Role == RoomRoleDefOf.RecRoom + || room.Role == RoomRoleDefOf.DiningRoom || room.Role == RoomRoleDefOf.Hospital + ) + __result += 15; // Add 15 instead of 10 to counteract the -5 in regular RJW + + Dictionary cell_doors = new Dictionary(); + + var doors = cell_doors.TryGetValue(room.ID); + + if (doors > 1) + __result += 7 * doors; // Multiply by 7 instead of 2 to counteract the negative in regular RJW + } + } + } +} diff --git a/RJW-Quirks/HarmonyPatches/Patch_CondomUtility.cs b/RJW-Quirks/HarmonyPatches/Patch_CondomUtility.cs new file mode 100644 index 0000000..3f3add0 --- /dev/null +++ b/RJW-Quirks/HarmonyPatches/Patch_CondomUtility.cs @@ -0,0 +1,37 @@ +using HarmonyLib; +using rjw; +using rjwquirks.Modules.Quirks; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace rjwquirks.HarmonyPatches +{ + // Skips condom code entirely if they have pregnation fetish or similar. RJW used to do this with the same quirk. + [HarmonyPatch(typeof(CondomUtility))] + public class Patch_CondomUtility + { + [HarmonyPrefix] + [HarmonyPatch(nameof(CondomUtility.TryUseCondom))] + public static bool UseCondomPrefix(Pawn pawn) + { + if (xxx.is_human(pawn) && pawn.HasQuirk(QuirkDefOf.ImpregnationFetish)) + return false; + + return true; + } + + [HarmonyPrefix] + [HarmonyPatch(nameof(CondomUtility.GetCondomFromRoom))] + public static bool GetCondomPrefix(Pawn pawn) + { + if (xxx.is_human(pawn) && pawn.HasQuirk(QuirkDefOf.ImpregnationFetish)) + return false; + + return true; + } + } +} diff --git a/RJW-Quirks/HarmonyPatches/Patch_Dialog_Sexcard.cs b/RJW-Quirks/HarmonyPatches/Patch_Dialog_Sexcard.cs new file mode 100644 index 0000000..0e54611 --- /dev/null +++ b/RJW-Quirks/HarmonyPatches/Patch_Dialog_Sexcard.cs @@ -0,0 +1,131 @@ +using HarmonyLib; +using rjw; +using rjwquirks.Modules.Quirks; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Reflection.Emit; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; + +namespace rjwquirks.HarmonyPatches +{ + [HarmonyPatch(typeof(Dialog_Sexcard), "SexualityCard")] + public static class Patch_Dialog_Sexcard + { + static IEnumerable Transpiler(IEnumerable instructions) + { + MethodInfo InsertQuirks = AccessTools.Method(typeof(Patch_Dialog_Sexcard), nameof(DrawQuirks)); + MethodInfo DrawSexuality = AccessTools.Method(typeof(Dialog_Sexcard), "DrawSexuality"); + bool found = false; + + // When RJW calls draw sexuality we inject our quirk drawing. + foreach (CodeInstruction i in instructions) + { + if (i.opcode == OpCodes.Call && i.operand as MethodInfo == DrawSexuality) + found = true; + + if (found) + { + yield return new CodeInstruction(OpCodes.Ldarg_2); + yield return new CodeInstruction(OpCodes.Ldloc_3); + yield return new CodeInstruction(OpCodes.Call, InsertQuirks); + found = false; + } + + yield return i; + } + } + + public static void DrawQuirks(Pawn pawn, Rect rect) + { + QuirkSet quirks = pawn.GetQuirks(); + rect.y += 24; + + if (quirks == null) + return; + + var quirkString = quirks.AllQuirks + .Select(quirk => quirk.Label) + .OrderBy(Label => Label) + .ToCommaList(); + + if ((Current.ProgramState == ProgramState.Playing && + pawn.IsDesignatedHero() && pawn.IsHeroOwner() || Prefs.DevMode) || + Current.ProgramState == ProgramState.Entry) + { + if (Widgets.ButtonText(rect, "Quirks".Translate() + quirkString, false)) + DrawQuirkEditMenu(pawn, quirks); + } + else + Widgets.Label(rect, "Quirks".Translate() + quirkString); + + if (!Mouse.IsOver(rect)) return; + + Widgets.DrawHighlight(rect); + + TooltipHandler.TipRegion(rect, quirks.TipString()); + } + + static void DrawQuirkEditMenu(Pawn pawn, QuirkSet quirks) + { + var quirkDefsAll = DefDatabase.AllDefs.OrderBy(def => def.GetLabelFor(pawn)); + + var menuOptions = new List(); + + if (RJWSettings.DevMode) + menuOptions.Add(new FloatMenuOption("[DEV] Forced Reset", () => quirks.Clear(true))); + + menuOptions.Add(new FloatMenuOption("Reset", () => quirks.Clear())); + + foreach (QuirkDef quirkDef in quirkDefsAll) + { + if (quirkDef.hidden && !RJWSettings.DevMode && !quirks.Contains(quirkDef)) + continue; + + Quirk quirk = quirks.GetQuirk(quirkDef); + FloatMenuOption option; + + if (quirk == null) + { + AcceptanceReport report = quirks.CanBeAdded(quirkDef); + if (report.Accepted) + { + option = new FloatMenuOption( + quirkDef.GetLabelFor(pawn), + () => quirks.AddQuirk(quirkDef), + mouseoverGuiAction: (Rect rect) => TooltipHandler.TipRegion(rect, quirkDef.GetDescriptionFor(pawn)) + ); + } + else if (RJWSettings.DevMode) + option = new FloatMenuOption($"[DEV]{quirkDef.GetLabelFor(pawn)}: {report.Reason}", () => quirks.AddQuirk(quirkDef, true)); + else + // Game does not call mouseoverGuiAction for the disabled entries + option = new FloatMenuOption($"{quirkDef.GetLabelFor(pawn)}: {report.Reason}", null); + } + else + { + AcceptanceReport report = quirks.CanBeRemoved(quirkDef); + if (report.Accepted) + { + option = new FloatMenuOption( + "- " + quirk.Label, + () => quirks.RemoveQuirk(quirk), + mouseoverGuiAction: (Rect rect) => TooltipHandler.TipRegion(rect, quirk.Description) + ); + } + else if (RJWSettings.DevMode) + option = new FloatMenuOption($"- {quirk.Label}: {report.Reason}", () => quirks.RemoveQuirk(quirk, true)); + else + option = new FloatMenuOption($"- {quirk.Label}: {report.Reason}", null); + } + + menuOptions.Add(option); + } + Find.WindowStack.Add(new FloatMenu(menuOptions)); + } + } +} diff --git a/RJW-Quirks/HarmonyPatches/Patch_DrawNude.cs b/RJW-Quirks/HarmonyPatches/Patch_DrawNude.cs new file mode 100644 index 0000000..b227131 --- /dev/null +++ b/RJW-Quirks/HarmonyPatches/Patch_DrawNude.cs @@ -0,0 +1,24 @@ +using HarmonyLib; +using rjw; +using rjwquirks.Modules.Quirks; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace rjwquirks.HarmonyPatches +{ + [HarmonyPatch(typeof(SexUtility), nameof(SexUtility.DrawNude))] + public class Patch_DrawNude + { + public static bool Prefix(Pawn pawn) + { + if (pawn.HasQuirk(QuirkDefOf.Endytophile)) + return false; + + return true; + } + } +} diff --git a/RJW-Quirks/HarmonyPatches/Patch_Hediff_BasePregnancy.cs b/RJW-Quirks/HarmonyPatches/Patch_Hediff_BasePregnancy.cs new file mode 100644 index 0000000..c5268a4 --- /dev/null +++ b/RJW-Quirks/HarmonyPatches/Patch_Hediff_BasePregnancy.cs @@ -0,0 +1,35 @@ +using HarmonyLib; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection.Emit; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace rjwquirks.HarmonyPatches +{ + /*[HarmonyPatch(typeof(Hediff_BasePregnancy))] + public class Patch_Hediff_BasePregnancy + { + [HarmonyTranspiler] + [HarmonyPatch("GenerateBabies")] + public static IEnumerable AdjustMaxLitterSize(IEnumerable instructions) + { + bool found = false; + + foreach (CodeInstruction i in instructions) + { + if (i.opcode == OpCodes.Ldc_R4 && i.operand as string == "0.33333334") + found = true; + + if (found && i.opcode == OpCodes.Stloc_S) + Log.Warning(i.operand as string); + + + yield return i; + } + } + }*/ +} diff --git a/RJW-Quirks/HarmonyPatches/Patch_Hediff_PartBaseArtifical.cs b/RJW-Quirks/HarmonyPatches/Patch_Hediff_PartBaseArtifical.cs new file mode 100644 index 0000000..b10bc50 --- /dev/null +++ b/RJW-Quirks/HarmonyPatches/Patch_Hediff_PartBaseArtifical.cs @@ -0,0 +1,43 @@ +using HarmonyLib; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Reflection.Emit; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace rjwquirks.HarmonyPatches +{ + [HarmonyPatch(typeof(Hediff_PartBaseArtifical))] + public class Patch_Hediff_PartBaseArtifical + { + [HarmonyTranspiler] + [HarmonyPatch(nameof(Hediff_PartBaseArtifical.Tick))] + public static IEnumerable ChangeMaxEggsSize(IEnumerable instructions) + { + FieldInfo Pawn = AccessTools.Field(typeof(Hediff_PartBaseArtifical), nameof(Hediff_PartBaseArtifical.pawn)); + MethodInfo EggSize = AccessTools.Method(typeof(Patch_Hediff_PartBaseArtifical), nameof(EditMaxEggsSize)); + + foreach (CodeInstruction i in instructions) + { + if (i.opcode == OpCodes.Ldc_R4 && i.operand as string == "0.0") + { + yield return new CodeInstruction(OpCodes.Ldfld, Pawn); + yield return new CodeInstruction(OpCodes.Ldloc_3); + yield return new CodeInstruction(OpCodes.Call, EggSize); + } + + yield return i; + } + } + + public static void EditMaxEggsSize(Pawn pawn, float eggsSize) + { + if (pawn.GetQuirks() != null) + pawn.GetQuirks().ApplyValueModifiers("maxEggsSize", ref eggsSize); + } + } +} diff --git a/RJW-Quirks/HarmonyPatches/Patch_Hediff_PartBaseNatural.cs b/RJW-Quirks/HarmonyPatches/Patch_Hediff_PartBaseNatural.cs new file mode 100644 index 0000000..9818e11 --- /dev/null +++ b/RJW-Quirks/HarmonyPatches/Patch_Hediff_PartBaseNatural.cs @@ -0,0 +1,47 @@ +using HarmonyLib; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection.Emit; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace rjwquirks.HarmonyPatches +{ + [HarmonyPatch(typeof(Hediff_PartBaseNatural))] + public class Patch_Hediff_PartBaseNatural + { + [HarmonyTranspiler] + [HarmonyPatch(nameof(Hediff_PartBaseNatural.Tick))] + public static IEnumerable ChangeMaxEggsSize(IEnumerable instructions) + { + FieldInfo Pawn = AccessTools.Field(typeof(Hediff_PartBaseNatural), nameof(Hediff_PartBaseNatural.pawn)); + MethodInfo EggSize = AccessTools.Method(typeof(Patch_Hediff_PartBaseNatural), nameof(EditMaxEggsSize)); + bool found = false; + + foreach (CodeInstruction i in instructions) + { + if (i.opcode == OpCodes.Ldc_R4 && i.operand as string == "0.0" && found) + { + yield return new CodeInstruction(OpCodes.Ldfld, Pawn); + yield return new CodeInstruction(OpCodes.Ldloc_3); + yield return new CodeInstruction(OpCodes.Call, EggSize); + } + + if (i.opcode == OpCodes.Ldc_R4 && i.operand as string == "0.0") + found = true; + + yield return i; + } + } + + public static void EditMaxEggsSize(Pawn pawn, float eggsSize) + { + if (pawn.GetQuirks() != null) + pawn.GetQuirks().ApplyValueModifiers("maxEggsSize", ref eggsSize); + } + } +} diff --git a/RJW-Quirks/HarmonyPatches/Patch_JobGiver_Masturbate.cs b/RJW-Quirks/HarmonyPatches/Patch_JobGiver_Masturbate.cs new file mode 100644 index 0000000..03ae20a --- /dev/null +++ b/RJW-Quirks/HarmonyPatches/Patch_JobGiver_Masturbate.cs @@ -0,0 +1,59 @@ +using HarmonyLib; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection.Emit; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Verse; +using rjwquirks.Modules.Quirks; + +namespace rjwquirks.HarmonyPatches +{ + /*[HarmonyPatch(typeof(JobGiver_Masturbate))] + public class Patch_JobGiver_Masturbate + { + [HarmonyTranspiler] + [HarmonyPatch("TryGiveJob")] + public static IEnumerable ApplyQuirkToMasturbate(IEnumerable instructions) + { + MethodInfo Frustrated = AccessTools.Method(typeof(xxx), nameof(xxx.is_frustrated)); + MethodInfo Apply = AccessTools.Method(typeof(Patch_JobGiver_Masturbate), nameof(ApplyQuirk)); + var labels = instructions.ElementAt(0).labels.ListFullCopy