commit c1dde0d447d351295141c56c9b410d989a687333 Author: moreoreganostodump Date: Mon Feb 1 20:29:29 2021 +0900 초기 커밋. diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4ce6fdd --- /dev/null +++ b/.gitignore @@ -0,0 +1,340 @@ +## 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/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# 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 + +# 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/ + +# 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 +*.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 + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# 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 +# 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 + +# 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 +*- Backup*.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 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 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/ + +# BeatPulse healthcheck temp database +healthchecksdb \ No newline at end of file diff --git a/About/About.xml b/About/About.xml new file mode 100644 index 0000000..32a15a0 --- /dev/null +++ b/About/About.xml @@ -0,0 +1,34 @@ + + + RJW Menstrution Cycle + a + +
  • 1.2
  • +
    + +
  • + brrainz.harmony + Harmony + steam://url/CommunityFilePage/2009463077 + https://github.com/pardeike/HarmonyRimWorld/releases/latest +
  • +
  • + UnlimitedHugs.HugsLib + HugsLib + https://github.com/UnlimitedHugs/RimworldHugsLib/releases/latest + steam://url/CommunityFilePage/818773962 +
  • +
  • + rim.job.world + RimJobWorld + https://gitgud.io/Ed86/rjw +
  • +
    + +
  • UnlimitedHugs.HugsLib
  • +
  • brrainz.harmony
  • +
  • rim.job.world
  • +
    + rjw.menstrution + yes yes +
    \ No newline at end of file diff --git a/About/PublishedFileId.txt b/About/PublishedFileId.txt new file mode 100644 index 0000000..14cb048 --- /dev/null +++ b/About/PublishedFileId.txt @@ -0,0 +1 @@ +2084961349 \ No newline at end of file diff --git a/About/preview.PNG b/About/preview.PNG new file mode 100644 index 0000000..be41043 Binary files /dev/null and b/About/preview.PNG differ diff --git a/Assemblies/RJW_Menstruation.dll b/Assemblies/RJW_Menstruation.dll new file mode 100644 index 0000000..51b7095 Binary files /dev/null and b/Assemblies/RJW_Menstruation.dll differ diff --git a/Assemblies/RJW_Menstruation.dll.config b/Assemblies/RJW_Menstruation.dll.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Assemblies/RJW_Menstruation.dll.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Assemblies/Unity.TextMeshPro.dll b/Assemblies/Unity.TextMeshPro.dll new file mode 100644 index 0000000..e3fd019 Binary files /dev/null and b/Assemblies/Unity.TextMeshPro.dll differ diff --git a/Defs/DNADef/DNADefs.xml b/Defs/DNADef/DNADefs.xml new file mode 100644 index 0000000..f4d4387 --- /dev/null +++ b/Defs/DNADef/DNADefs.xml @@ -0,0 +1,13 @@ + + + + Human + + Fetus/Fetus_Default + (255,255,255,255) + 0.2 + + + + + diff --git a/Languages/English/Keyed/RJW_Menstruation.xml b/Languages/English/Keyed/RJW_Menstruation.xml new file mode 100644 index 0000000..cf72e2d --- /dev/null +++ b/Languages/English/Keyed/RJW_Menstruation.xml @@ -0,0 +1,48 @@ + + + RJW Menstrution Cycle + + menstrual blood + Empty + Follicular + Ovulation + Luteal + In period + Luteal + Pregnant + Recovering from birth + State + Fetus + Father + Cum list + Fertilized + Fertilizing + Ovulation + + + + enable womb icon + enable womb icon gizmo + enable animal cycle + simulate animal's cycle. this option will apply after save loaded not recommended + implantation chance + set implantation chance of fertilized egg + fertilization chance + set fertilize chance of sperm on every hour + cum decay ratio per hour + cum will decrease about this ratio + cum fertility decay ratio per hour + cum will lose fertility about this ratio + cycle accelerate + accelerate menstrution cycle + Debug + show debug informations. + + + + + + + + + \ No newline at end of file diff --git a/Patches/Drugs.xml b/Patches/Drugs.xml new file mode 100644 index 0000000..cd6dbae --- /dev/null +++ b/Patches/Drugs.xml @@ -0,0 +1,10 @@ + + + + + Defs/ThingDef[defName="RJW_FertPill"]/ingestible/outcomeDoers + +
  • + + + \ No newline at end of file diff --git a/Patches/Hediffs.xml b/Patches/Hediffs.xml new file mode 100644 index 0000000..cbef992 --- /dev/null +++ b/Patches/Hediffs.xml @@ -0,0 +1,19 @@ + + + + + Defs/HediffDef[defName="RJW_IUD"]/stages + + +
  • + +
  • + RJW_Fertility + 1.0 +
  • + + + +
    +
    +
    \ No newline at end of file diff --git a/Patches/Hediffs_PrivateParts.xml b/Patches/Hediffs_PrivateParts.xml new file mode 100644 index 0000000..356add0 --- /dev/null +++ b/Patches/Hediffs_PrivateParts.xml @@ -0,0 +1,28 @@ + + + + + + + + + + Defs/rjw.HediffDef_PartBase[defName="Vagina"] + + +
  • + 500 + 1.0 + 1.0 + 0.05 + 14 + 14 + 6 + 10 + 3 + Womb/Womb +
  • +
    +
    +
    +
    \ No newline at end of file diff --git a/Textures/Fetus/Fetus_Brown00.png b/Textures/Fetus/Fetus_Brown00.png new file mode 100644 index 0000000..3df90a7 Binary files /dev/null and b/Textures/Fetus/Fetus_Brown00.png differ diff --git a/Textures/Fetus/Fetus_Brown01.png b/Textures/Fetus/Fetus_Brown01.png new file mode 100644 index 0000000..b4e25bb Binary files /dev/null and b/Textures/Fetus/Fetus_Brown01.png differ diff --git a/Textures/Fetus/Fetus_Brown02.png b/Textures/Fetus/Fetus_Brown02.png new file mode 100644 index 0000000..b40e3e7 Binary files /dev/null and b/Textures/Fetus/Fetus_Brown02.png differ diff --git a/Textures/Fetus/Fetus_Brown03.png b/Textures/Fetus/Fetus_Brown03.png new file mode 100644 index 0000000..40e1742 Binary files /dev/null and b/Textures/Fetus/Fetus_Brown03.png differ diff --git a/Textures/Fetus/Fetus_Default00.png b/Textures/Fetus/Fetus_Default00.png new file mode 100644 index 0000000..15821cf Binary files /dev/null and b/Textures/Fetus/Fetus_Default00.png differ diff --git a/Textures/Fetus/Fetus_Default01.png b/Textures/Fetus/Fetus_Default01.png new file mode 100644 index 0000000..c864dc1 Binary files /dev/null and b/Textures/Fetus/Fetus_Default01.png differ diff --git a/Textures/Fetus/Fetus_Default02.png b/Textures/Fetus/Fetus_Default02.png new file mode 100644 index 0000000..14ca2d2 Binary files /dev/null and b/Textures/Fetus/Fetus_Default02.png differ diff --git a/Textures/Fetus/Fetus_Default03.png b/Textures/Fetus/Fetus_Default03.png new file mode 100644 index 0000000..47a3141 Binary files /dev/null and b/Textures/Fetus/Fetus_Default03.png differ diff --git a/Textures/Fetus/Fetus_Default04.png b/Textures/Fetus/Fetus_Default04.png new file mode 100644 index 0000000..2b04b93 Binary files /dev/null and b/Textures/Fetus/Fetus_Default04.png differ diff --git a/Textures/Fetus/Fetus_Default05.png b/Textures/Fetus/Fetus_Default05.png new file mode 100644 index 0000000..026d575 Binary files /dev/null and b/Textures/Fetus/Fetus_Default05.png differ diff --git a/Textures/Fetus/Fetus_Early00.png b/Textures/Fetus/Fetus_Early00.png new file mode 100644 index 0000000..9ac60a6 Binary files /dev/null and b/Textures/Fetus/Fetus_Early00.png differ diff --git a/Textures/Fetus/Fetus_Green00.png b/Textures/Fetus/Fetus_Green00.png new file mode 100644 index 0000000..cdf8600 Binary files /dev/null and b/Textures/Fetus/Fetus_Green00.png differ diff --git a/Textures/Fetus/Fetus_Green01.png b/Textures/Fetus/Fetus_Green01.png new file mode 100644 index 0000000..fac6c7e Binary files /dev/null and b/Textures/Fetus/Fetus_Green01.png differ diff --git a/Textures/Fetus/Fetus_Green02.png b/Textures/Fetus/Fetus_Green02.png new file mode 100644 index 0000000..30f7ae5 Binary files /dev/null and b/Textures/Fetus/Fetus_Green02.png differ diff --git a/Textures/Fetus/Fetus_Green03.png b/Textures/Fetus/Fetus_Green03.png new file mode 100644 index 0000000..9ef6076 Binary files /dev/null and b/Textures/Fetus/Fetus_Green03.png differ diff --git a/Textures/Fetus/Fetus_Orc00.png b/Textures/Fetus/Fetus_Orc00.png new file mode 100644 index 0000000..9e4bdbd Binary files /dev/null and b/Textures/Fetus/Fetus_Orc00.png differ diff --git a/Textures/Fetus/Fetus_Orc01.png b/Textures/Fetus/Fetus_Orc01.png new file mode 100644 index 0000000..90cffe0 Binary files /dev/null and b/Textures/Fetus/Fetus_Orc01.png differ diff --git a/Textures/Fetus/Fetus_Orc02.png b/Textures/Fetus/Fetus_Orc02.png new file mode 100644 index 0000000..ac28262 Binary files /dev/null and b/Textures/Fetus/Fetus_Orc02.png differ diff --git a/Textures/Fetus/Fetus_Orc03.png b/Textures/Fetus/Fetus_Orc03.png new file mode 100644 index 0000000..c736b55 Binary files /dev/null and b/Textures/Fetus/Fetus_Orc03.png differ diff --git a/Textures/Fetus/Fetus_default.psd b/Textures/Fetus/Fetus_default.psd new file mode 100644 index 0000000..be32b68 Binary files /dev/null and b/Textures/Fetus/Fetus_default.psd differ diff --git a/Textures/Fetus/Slime_Abomi02.png b/Textures/Fetus/Slime_Abomi02.png new file mode 100644 index 0000000..612481f Binary files /dev/null and b/Textures/Fetus/Slime_Abomi02.png differ diff --git a/Textures/Fetus/Slime_Black02.png b/Textures/Fetus/Slime_Black02.png new file mode 100644 index 0000000..8094fc6 Binary files /dev/null and b/Textures/Fetus/Slime_Black02.png differ diff --git a/Textures/Fetus/Slime_Blue02.png b/Textures/Fetus/Slime_Blue02.png new file mode 100644 index 0000000..6ee8a45 Binary files /dev/null and b/Textures/Fetus/Slime_Blue02.png differ diff --git a/Textures/Fetus/Slime_Default00.png b/Textures/Fetus/Slime_Default00.png new file mode 100644 index 0000000..db17277 Binary files /dev/null and b/Textures/Fetus/Slime_Default00.png differ diff --git a/Textures/Fetus/Slime_Default01.png b/Textures/Fetus/Slime_Default01.png new file mode 100644 index 0000000..817f77d Binary files /dev/null and b/Textures/Fetus/Slime_Default01.png differ diff --git a/Textures/Fetus/Slime_Default02.png b/Textures/Fetus/Slime_Default02.png new file mode 100644 index 0000000..fa3805b Binary files /dev/null and b/Textures/Fetus/Slime_Default02.png differ diff --git a/Textures/Fetus/Slime_Pink02.png b/Textures/Fetus/Slime_Pink02.png new file mode 100644 index 0000000..eb560c5 Binary files /dev/null and b/Textures/Fetus/Slime_Pink02.png differ diff --git a/Textures/Fetus/Slime_Red02.png b/Textures/Fetus/Slime_Red02.png new file mode 100644 index 0000000..0ecb289 Binary files /dev/null and b/Textures/Fetus/Slime_Red02.png differ diff --git a/Textures/Fetus/Slime_Yellow02.png b/Textures/Fetus/Slime_Yellow02.png new file mode 100644 index 0000000..818f2d0 Binary files /dev/null and b/Textures/Fetus/Slime_Yellow02.png differ diff --git a/Textures/Fetus_small/Fetus_Brown00.png b/Textures/Fetus_small/Fetus_Brown00.png new file mode 100644 index 0000000..3df90a7 Binary files /dev/null and b/Textures/Fetus_small/Fetus_Brown00.png differ diff --git a/Textures/Fetus_small/Fetus_Brown01.png b/Textures/Fetus_small/Fetus_Brown01.png new file mode 100644 index 0000000..b4e25bb Binary files /dev/null and b/Textures/Fetus_small/Fetus_Brown01.png differ diff --git a/Textures/Fetus_small/Fetus_Brown02.png b/Textures/Fetus_small/Fetus_Brown02.png new file mode 100644 index 0000000..b40e3e7 Binary files /dev/null and b/Textures/Fetus_small/Fetus_Brown02.png differ diff --git a/Textures/Fetus_small/Fetus_Brown03.png b/Textures/Fetus_small/Fetus_Brown03.png new file mode 100644 index 0000000..40e1742 Binary files /dev/null and b/Textures/Fetus_small/Fetus_Brown03.png differ diff --git a/Textures/Fetus_small/Fetus_Default00.png b/Textures/Fetus_small/Fetus_Default00.png new file mode 100644 index 0000000..b56cde5 Binary files /dev/null and b/Textures/Fetus_small/Fetus_Default00.png differ diff --git a/Textures/Fetus_small/Fetus_Default01.png b/Textures/Fetus_small/Fetus_Default01.png new file mode 100644 index 0000000..f11d1ae Binary files /dev/null and b/Textures/Fetus_small/Fetus_Default01.png differ diff --git a/Textures/Fetus_small/Fetus_Default02.png b/Textures/Fetus_small/Fetus_Default02.png new file mode 100644 index 0000000..7ef4239 Binary files /dev/null and b/Textures/Fetus_small/Fetus_Default02.png differ diff --git a/Textures/Fetus_small/Fetus_Default03.png b/Textures/Fetus_small/Fetus_Default03.png new file mode 100644 index 0000000..8197f1c Binary files /dev/null and b/Textures/Fetus_small/Fetus_Default03.png differ diff --git a/Textures/Fetus_small/Fetus_Early00.png b/Textures/Fetus_small/Fetus_Early00.png new file mode 100644 index 0000000..232cdb4 Binary files /dev/null and b/Textures/Fetus_small/Fetus_Early00.png differ diff --git a/Textures/Fetus_small/Fetus_Early01.png b/Textures/Fetus_small/Fetus_Early01.png new file mode 100644 index 0000000..c884fdc Binary files /dev/null and b/Textures/Fetus_small/Fetus_Early01.png differ diff --git a/Textures/Fetus_small/Fetus_Early02.png b/Textures/Fetus_small/Fetus_Early02.png new file mode 100644 index 0000000..f52b5f3 Binary files /dev/null and b/Textures/Fetus_small/Fetus_Early02.png differ diff --git a/Textures/Fetus_small/Fetus_Green00.png b/Textures/Fetus_small/Fetus_Green00.png new file mode 100644 index 0000000..cdf8600 Binary files /dev/null and b/Textures/Fetus_small/Fetus_Green00.png differ diff --git a/Textures/Fetus_small/Fetus_Green01.png b/Textures/Fetus_small/Fetus_Green01.png new file mode 100644 index 0000000..fac6c7e Binary files /dev/null and b/Textures/Fetus_small/Fetus_Green01.png differ diff --git a/Textures/Fetus_small/Fetus_Green02.png b/Textures/Fetus_small/Fetus_Green02.png new file mode 100644 index 0000000..30f7ae5 Binary files /dev/null and b/Textures/Fetus_small/Fetus_Green02.png differ diff --git a/Textures/Fetus_small/Fetus_Green03.png b/Textures/Fetus_small/Fetus_Green03.png new file mode 100644 index 0000000..9ef6076 Binary files /dev/null and b/Textures/Fetus_small/Fetus_Green03.png differ diff --git a/Textures/Fetus_small/Fetus_Orc00.png b/Textures/Fetus_small/Fetus_Orc00.png new file mode 100644 index 0000000..3637251 Binary files /dev/null and b/Textures/Fetus_small/Fetus_Orc00.png differ diff --git a/Textures/Fetus_small/Fetus_Orc01.png b/Textures/Fetus_small/Fetus_Orc01.png new file mode 100644 index 0000000..769edba Binary files /dev/null and b/Textures/Fetus_small/Fetus_Orc01.png differ diff --git a/Textures/Fetus_small/Fetus_Orc02.png b/Textures/Fetus_small/Fetus_Orc02.png new file mode 100644 index 0000000..939af97 Binary files /dev/null and b/Textures/Fetus_small/Fetus_Orc02.png differ diff --git a/Textures/Fetus_small/Fetus_Orc03.png b/Textures/Fetus_small/Fetus_Orc03.png new file mode 100644 index 0000000..6e9d9cb Binary files /dev/null and b/Textures/Fetus_small/Fetus_Orc03.png differ diff --git a/Textures/Fetus_small/ImplantedEgg.png b/Textures/Fetus_small/ImplantedEgg.png new file mode 100644 index 0000000..3b5769c Binary files /dev/null and b/Textures/Fetus_small/ImplantedEgg.png differ diff --git a/Textures/Fetus_small/Slime_Abomi02.png b/Textures/Fetus_small/Slime_Abomi02.png new file mode 100644 index 0000000..325d613 Binary files /dev/null and b/Textures/Fetus_small/Slime_Abomi02.png differ diff --git a/Textures/Fetus_small/Slime_Black02.png b/Textures/Fetus_small/Slime_Black02.png new file mode 100644 index 0000000..8094fc6 Binary files /dev/null and b/Textures/Fetus_small/Slime_Black02.png differ diff --git a/Textures/Fetus_small/Slime_Blue02.png b/Textures/Fetus_small/Slime_Blue02.png new file mode 100644 index 0000000..754909d Binary files /dev/null and b/Textures/Fetus_small/Slime_Blue02.png differ diff --git a/Textures/Fetus_small/Slime_Default00.png b/Textures/Fetus_small/Slime_Default00.png new file mode 100644 index 0000000..b20b609 Binary files /dev/null and b/Textures/Fetus_small/Slime_Default00.png differ diff --git a/Textures/Fetus_small/Slime_Default01.png b/Textures/Fetus_small/Slime_Default01.png new file mode 100644 index 0000000..9b9d95c Binary files /dev/null and b/Textures/Fetus_small/Slime_Default01.png differ diff --git a/Textures/Fetus_small/Slime_Default02.png b/Textures/Fetus_small/Slime_Default02.png new file mode 100644 index 0000000..b05119e Binary files /dev/null and b/Textures/Fetus_small/Slime_Default02.png differ diff --git a/Textures/Fetus_small/Slime_Pink02.png b/Textures/Fetus_small/Slime_Pink02.png new file mode 100644 index 0000000..eb560c5 Binary files /dev/null and b/Textures/Fetus_small/Slime_Pink02.png differ diff --git a/Textures/Fetus_small/Slime_Red02.png b/Textures/Fetus_small/Slime_Red02.png new file mode 100644 index 0000000..0ecb289 Binary files /dev/null and b/Textures/Fetus_small/Slime_Red02.png differ diff --git a/Textures/Fetus_small/Slime_Yellow02.png b/Textures/Fetus_small/Slime_Yellow02.png new file mode 100644 index 0000000..818f2d0 Binary files /dev/null and b/Textures/Fetus_small/Slime_Yellow02.png differ diff --git a/Textures/Genitals/Anal00.png b/Textures/Genitals/Anal00.png new file mode 100644 index 0000000..4f996e4 Binary files /dev/null and b/Textures/Genitals/Anal00.png differ diff --git a/Textures/Genitals/Anal01.png b/Textures/Genitals/Anal01.png new file mode 100644 index 0000000..4cc4bb8 Binary files /dev/null and b/Textures/Genitals/Anal01.png differ diff --git a/Textures/Genitals/Anal02.png b/Textures/Genitals/Anal02.png new file mode 100644 index 0000000..b9d8281 Binary files /dev/null and b/Textures/Genitals/Anal02.png differ diff --git a/Textures/Genitals/Anal03.png b/Textures/Genitals/Anal03.png new file mode 100644 index 0000000..c8b1a2a Binary files /dev/null and b/Textures/Genitals/Anal03.png differ diff --git a/Textures/Genitals/Anal04.png b/Textures/Genitals/Anal04.png new file mode 100644 index 0000000..bffab9c Binary files /dev/null and b/Textures/Genitals/Anal04.png differ diff --git a/Textures/Genitals/Anal05.png b/Textures/Genitals/Anal05.png new file mode 100644 index 0000000..9703a2c Binary files /dev/null and b/Textures/Genitals/Anal05.png differ diff --git a/Textures/Genitals/Vagina00.png b/Textures/Genitals/Vagina00.png new file mode 100644 index 0000000..ef93c1a Binary files /dev/null and b/Textures/Genitals/Vagina00.png differ diff --git a/Textures/Genitals/Vagina01.png b/Textures/Genitals/Vagina01.png new file mode 100644 index 0000000..b245289 Binary files /dev/null and b/Textures/Genitals/Vagina01.png differ diff --git a/Textures/Genitals/Vagina02.png b/Textures/Genitals/Vagina02.png new file mode 100644 index 0000000..5bdc25f Binary files /dev/null and b/Textures/Genitals/Vagina02.png differ diff --git a/Textures/Genitals/Vagina03.png b/Textures/Genitals/Vagina03.png new file mode 100644 index 0000000..6e36f13 Binary files /dev/null and b/Textures/Genitals/Vagina03.png differ diff --git a/Textures/Genitals/Vagina04.png b/Textures/Genitals/Vagina04.png new file mode 100644 index 0000000..410d448 Binary files /dev/null and b/Textures/Genitals/Vagina04.png differ diff --git a/Textures/Genitals/Vagina05.png b/Textures/Genitals/Vagina05.png new file mode 100644 index 0000000..ffa936b Binary files /dev/null and b/Textures/Genitals/Vagina05.png differ diff --git a/Textures/Genitals/Vagina06.png b/Textures/Genitals/Vagina06.png new file mode 100644 index 0000000..43a7f0f Binary files /dev/null and b/Textures/Genitals/Vagina06.png differ diff --git a/Textures/Genitals/Vagina07.png b/Textures/Genitals/Vagina07.png new file mode 100644 index 0000000..8322f98 Binary files /dev/null and b/Textures/Genitals/Vagina07.png differ diff --git a/Textures/Genitals/Vagina08.png b/Textures/Genitals/Vagina08.png new file mode 100644 index 0000000..aec384c Binary files /dev/null and b/Textures/Genitals/Vagina08.png differ diff --git a/Textures/Genitals/Vagina09.png b/Textures/Genitals/Vagina09.png new file mode 100644 index 0000000..aec384c Binary files /dev/null and b/Textures/Genitals/Vagina09.png differ diff --git a/Textures/Genitals/Vagina10.png b/Textures/Genitals/Vagina10.png new file mode 100644 index 0000000..bf78803 Binary files /dev/null and b/Textures/Genitals/Vagina10.png differ diff --git a/Textures/Genitals/Vagina11.png b/Textures/Genitals/Vagina11.png new file mode 100644 index 0000000..4f75054 Binary files /dev/null and b/Textures/Genitals/Vagina11.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal00.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal00.png new file mode 100644 index 0000000..2923a23 Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal00.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal01.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal01.png new file mode 100644 index 0000000..432b0b8 Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal01.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal02.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal02.png new file mode 100644 index 0000000..a251d81 Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal02.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal03.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal03.png new file mode 100644 index 0000000..2f81bd1 Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal03.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal04.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal04.png new file mode 100644 index 0000000..02459be Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal04.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal05.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal05.png new file mode 100644 index 0000000..10541df Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal05.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal2_00.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal2_00.png new file mode 100644 index 0000000..abe20b9 Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Anal2_00.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina00.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina00.png new file mode 100644 index 0000000..fd028b4 Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina00.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina01.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina01.png new file mode 100644 index 0000000..f21f123 Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina01.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina02.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina02.png new file mode 100644 index 0000000..37f6830 Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina02.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina03.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina03.png new file mode 100644 index 0000000..53ab1cb Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina03.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina04.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina04.png new file mode 100644 index 0000000..70eba1f Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina04.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina05.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina05.png new file mode 100644 index 0000000..c19e597 Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina05.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina06.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina06.png new file mode 100644 index 0000000..d381cb1 Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina06.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina07.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina07.png new file mode 100644 index 0000000..7565f91 Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina07.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina08.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina08.png new file mode 100644 index 0000000..99d1def Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina08.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina09.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina09.png new file mode 100644 index 0000000..99d1def Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina09.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina10.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina10.png new file mode 100644 index 0000000..0c70534 Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina10.png differ diff --git a/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina11.png b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina11.png new file mode 100644 index 0000000..d90afad Binary files /dev/null and b/Textures/Genitals_old(RGB)(noise_scale)(Level1)(x2.000000)(16bit)/Vagina11.png differ diff --git a/Textures/Genitals_old/Anal00.png b/Textures/Genitals_old/Anal00.png new file mode 100644 index 0000000..3e4a0df Binary files /dev/null and b/Textures/Genitals_old/Anal00.png differ diff --git a/Textures/Genitals_old/Anal01.png b/Textures/Genitals_old/Anal01.png new file mode 100644 index 0000000..dd2e2b7 Binary files /dev/null and b/Textures/Genitals_old/Anal01.png differ diff --git a/Textures/Genitals_old/Anal02.png b/Textures/Genitals_old/Anal02.png new file mode 100644 index 0000000..97ce6a0 Binary files /dev/null and b/Textures/Genitals_old/Anal02.png differ diff --git a/Textures/Genitals_old/Anal03.png b/Textures/Genitals_old/Anal03.png new file mode 100644 index 0000000..b55f8d3 Binary files /dev/null and b/Textures/Genitals_old/Anal03.png differ diff --git a/Textures/Genitals_old/Anal04.png b/Textures/Genitals_old/Anal04.png new file mode 100644 index 0000000..21b6fb5 Binary files /dev/null and b/Textures/Genitals_old/Anal04.png differ diff --git a/Textures/Genitals_old/Anal05.png b/Textures/Genitals_old/Anal05.png new file mode 100644 index 0000000..adf9ba5 Binary files /dev/null and b/Textures/Genitals_old/Anal05.png differ diff --git a/Textures/Genitals_old/Anal2_00.png b/Textures/Genitals_old/Anal2_00.png new file mode 100644 index 0000000..cb175a6 Binary files /dev/null and b/Textures/Genitals_old/Anal2_00.png differ diff --git a/Textures/Genitals_old/Genitals.zip b/Textures/Genitals_old/Genitals.zip new file mode 100644 index 0000000..ccd7cc9 Binary files /dev/null and b/Textures/Genitals_old/Genitals.zip differ diff --git a/Textures/Genitals_old/Vagina00.png b/Textures/Genitals_old/Vagina00.png new file mode 100644 index 0000000..f8f2ec3 Binary files /dev/null and b/Textures/Genitals_old/Vagina00.png differ diff --git a/Textures/Genitals_old/Vagina01.png b/Textures/Genitals_old/Vagina01.png new file mode 100644 index 0000000..7c966bb Binary files /dev/null and b/Textures/Genitals_old/Vagina01.png differ diff --git a/Textures/Genitals_old/Vagina02.png b/Textures/Genitals_old/Vagina02.png new file mode 100644 index 0000000..496c1b6 Binary files /dev/null and b/Textures/Genitals_old/Vagina02.png differ diff --git a/Textures/Genitals_old/Vagina03.png b/Textures/Genitals_old/Vagina03.png new file mode 100644 index 0000000..8ef46dd Binary files /dev/null and b/Textures/Genitals_old/Vagina03.png differ diff --git a/Textures/Genitals_old/Vagina04.png b/Textures/Genitals_old/Vagina04.png new file mode 100644 index 0000000..badddf8 Binary files /dev/null and b/Textures/Genitals_old/Vagina04.png differ diff --git a/Textures/Genitals_old/Vagina05.png b/Textures/Genitals_old/Vagina05.png new file mode 100644 index 0000000..b790cf4 Binary files /dev/null and b/Textures/Genitals_old/Vagina05.png differ diff --git a/Textures/Genitals_old/Vagina06.png b/Textures/Genitals_old/Vagina06.png new file mode 100644 index 0000000..1328f40 Binary files /dev/null and b/Textures/Genitals_old/Vagina06.png differ diff --git a/Textures/Genitals_old/Vagina07.png b/Textures/Genitals_old/Vagina07.png new file mode 100644 index 0000000..db8afb7 Binary files /dev/null and b/Textures/Genitals_old/Vagina07.png differ diff --git a/Textures/Genitals_old/Vagina08.png b/Textures/Genitals_old/Vagina08.png new file mode 100644 index 0000000..e2cb3fe Binary files /dev/null and b/Textures/Genitals_old/Vagina08.png differ diff --git a/Textures/Genitals_old/Vagina09.png b/Textures/Genitals_old/Vagina09.png new file mode 100644 index 0000000..ff16fb4 Binary files /dev/null and b/Textures/Genitals_old/Vagina09.png differ diff --git a/Textures/Genitals_old/Vagina10.png b/Textures/Genitals_old/Vagina10.png new file mode 100644 index 0000000..0ab5f78 Binary files /dev/null and b/Textures/Genitals_old/Vagina10.png differ diff --git a/Textures/Genitals_old/Vagina11.png b/Textures/Genitals_old/Vagina11.png new file mode 100644 index 0000000..b493620 Binary files /dev/null and b/Textures/Genitals_old/Vagina11.png differ diff --git a/Textures/Textures_old.7z b/Textures/Textures_old.7z new file mode 100644 index 0000000..a967dfb Binary files /dev/null and b/Textures/Textures_old.7z differ diff --git a/Textures/Womb/Cum.psd b/Textures/Womb/Cum.psd new file mode 100644 index 0000000..f163dfc Binary files /dev/null and b/Textures/Womb/Cum.psd differ diff --git a/Textures/Womb/Cum_00.png b/Textures/Womb/Cum_00.png new file mode 100644 index 0000000..a74ae70 Binary files /dev/null and b/Textures/Womb/Cum_00.png differ diff --git a/Textures/Womb/Cum_01.png b/Textures/Womb/Cum_01.png new file mode 100644 index 0000000..f77ddd3 Binary files /dev/null and b/Textures/Womb/Cum_01.png differ diff --git a/Textures/Womb/Cum_02.png b/Textures/Womb/Cum_02.png new file mode 100644 index 0000000..c8c95f4 Binary files /dev/null and b/Textures/Womb/Cum_02.png differ diff --git a/Textures/Womb/Cum_03.png b/Textures/Womb/Cum_03.png new file mode 100644 index 0000000..0fe5eb9 Binary files /dev/null and b/Textures/Womb/Cum_03.png differ diff --git a/Textures/Womb/Cum_04.png b/Textures/Womb/Cum_04.png new file mode 100644 index 0000000..75f7691 Binary files /dev/null and b/Textures/Womb/Cum_04.png differ diff --git a/Textures/Womb/Cum_05.png b/Textures/Womb/Cum_05.png new file mode 100644 index 0000000..97c8794 Binary files /dev/null and b/Textures/Womb/Cum_05.png differ diff --git a/Textures/Womb/Cum_06.png b/Textures/Womb/Cum_06.png new file mode 100644 index 0000000..fa50a59 Binary files /dev/null and b/Textures/Womb/Cum_06.png differ diff --git a/Textures/Womb/Cum_07.png b/Textures/Womb/Cum_07.png new file mode 100644 index 0000000..06b1687 Binary files /dev/null and b/Textures/Womb/Cum_07.png differ diff --git a/Textures/Womb/Cum_08.png b/Textures/Womb/Cum_08.png new file mode 100644 index 0000000..941dd3c Binary files /dev/null and b/Textures/Womb/Cum_08.png differ diff --git a/Textures/Womb/Cum_09.png b/Textures/Womb/Cum_09.png new file mode 100644 index 0000000..cfe1e35 Binary files /dev/null and b/Textures/Womb/Cum_09.png differ diff --git a/Textures/Womb/Cum_10.png b/Textures/Womb/Cum_10.png new file mode 100644 index 0000000..c27e4c5 Binary files /dev/null and b/Textures/Womb/Cum_10.png differ diff --git a/Textures/Womb/Cum_11.png b/Textures/Womb/Cum_11.png new file mode 100644 index 0000000..4005794 Binary files /dev/null and b/Textures/Womb/Cum_11.png differ diff --git a/Textures/Womb/Cum_12.png b/Textures/Womb/Cum_12.png new file mode 100644 index 0000000..1a4644a Binary files /dev/null and b/Textures/Womb/Cum_12.png differ diff --git a/Textures/Womb/Cum_13.png b/Textures/Womb/Cum_13.png new file mode 100644 index 0000000..33d34e5 Binary files /dev/null and b/Textures/Womb/Cum_13.png differ diff --git a/Textures/Womb/Cum_14.png b/Textures/Womb/Cum_14.png new file mode 100644 index 0000000..9cdde2d Binary files /dev/null and b/Textures/Womb/Cum_14.png differ diff --git a/Textures/Womb/Cum_15.png b/Textures/Womb/Cum_15.png new file mode 100644 index 0000000..a941ed4 Binary files /dev/null and b/Textures/Womb/Cum_15.png differ diff --git a/Textures/Womb/Cum_16.png b/Textures/Womb/Cum_16.png new file mode 100644 index 0000000..8650155 Binary files /dev/null and b/Textures/Womb/Cum_16.png differ diff --git a/Textures/Womb/Cum_17.png b/Textures/Womb/Cum_17.png new file mode 100644 index 0000000..4904d44 Binary files /dev/null and b/Textures/Womb/Cum_17.png differ diff --git a/Textures/Womb/Empty.png b/Textures/Womb/Empty.png new file mode 100644 index 0000000..1aa9036 Binary files /dev/null and b/Textures/Womb/Empty.png differ diff --git a/Textures/Womb/ImplantedEgg.png b/Textures/Womb/ImplantedEgg.png new file mode 100644 index 0000000..a109402 Binary files /dev/null and b/Textures/Womb/ImplantedEgg.png differ diff --git a/Textures/Womb/Mechanoid_Fluid.png b/Textures/Womb/Mechanoid_Fluid.png new file mode 100644 index 0000000..6ee8a45 Binary files /dev/null and b/Textures/Womb/Mechanoid_Fluid.png differ diff --git a/Textures/Womb/Womb.7z b/Textures/Womb/Womb.7z new file mode 100644 index 0000000..9041c54 Binary files /dev/null and b/Textures/Womb/Womb.7z differ diff --git a/Textures/Womb/Womb.png b/Textures/Womb/Womb.png new file mode 100644 index 0000000..3341c14 Binary files /dev/null and b/Textures/Womb/Womb.png differ diff --git a/Textures/Womb/Womb_Bleeding.png b/Textures/Womb/Womb_Bleeding.png new file mode 100644 index 0000000..1af20dc Binary files /dev/null and b/Textures/Womb/Womb_Bleeding.png differ diff --git a/Textures/Womb/Womb_Cum.psd b/Textures/Womb/Womb_Cum.psd new file mode 100644 index 0000000..5233020 Binary files /dev/null and b/Textures/Womb/Womb_Cum.psd differ diff --git a/Textures/Womb/Womb_Implanted.png b/Textures/Womb/Womb_Implanted.png new file mode 100644 index 0000000..bc97522 Binary files /dev/null and b/Textures/Womb/Womb_Implanted.png differ diff --git a/Textures/Womb_old/Cum.psd b/Textures/Womb_old/Cum.psd new file mode 100644 index 0000000..f163dfc Binary files /dev/null and b/Textures/Womb_old/Cum.psd differ diff --git a/Textures/Womb_old/Cum_00.png b/Textures/Womb_old/Cum_00.png new file mode 100644 index 0000000..e399317 Binary files /dev/null and b/Textures/Womb_old/Cum_00.png differ diff --git a/Textures/Womb_old/Cum_01.png b/Textures/Womb_old/Cum_01.png new file mode 100644 index 0000000..cccb471 Binary files /dev/null and b/Textures/Womb_old/Cum_01.png differ diff --git a/Textures/Womb_old/Cum_02.png b/Textures/Womb_old/Cum_02.png new file mode 100644 index 0000000..ed4f690 Binary files /dev/null and b/Textures/Womb_old/Cum_02.png differ diff --git a/Textures/Womb_old/Cum_03.png b/Textures/Womb_old/Cum_03.png new file mode 100644 index 0000000..cd6cbff Binary files /dev/null and b/Textures/Womb_old/Cum_03.png differ diff --git a/Textures/Womb_old/Cum_04.png b/Textures/Womb_old/Cum_04.png new file mode 100644 index 0000000..48a5101 Binary files /dev/null and b/Textures/Womb_old/Cum_04.png differ diff --git a/Textures/Womb_old/Cum_05.png b/Textures/Womb_old/Cum_05.png new file mode 100644 index 0000000..8bd5f29 Binary files /dev/null and b/Textures/Womb_old/Cum_05.png differ diff --git a/Textures/Womb_old/Cum_06.png b/Textures/Womb_old/Cum_06.png new file mode 100644 index 0000000..76e94c1 Binary files /dev/null and b/Textures/Womb_old/Cum_06.png differ diff --git a/Textures/Womb_old/Cum_07.png b/Textures/Womb_old/Cum_07.png new file mode 100644 index 0000000..d4629d4 Binary files /dev/null and b/Textures/Womb_old/Cum_07.png differ diff --git a/Textures/Womb_old/Cum_08.png b/Textures/Womb_old/Cum_08.png new file mode 100644 index 0000000..9bb7992 Binary files /dev/null and b/Textures/Womb_old/Cum_08.png differ diff --git a/Textures/Womb_old/Cum_09.png b/Textures/Womb_old/Cum_09.png new file mode 100644 index 0000000..fb5c539 Binary files /dev/null and b/Textures/Womb_old/Cum_09.png differ diff --git a/Textures/Womb_old/Cum_10.png b/Textures/Womb_old/Cum_10.png new file mode 100644 index 0000000..314753a Binary files /dev/null and b/Textures/Womb_old/Cum_10.png differ diff --git a/Textures/Womb_old/Cum_11.png b/Textures/Womb_old/Cum_11.png new file mode 100644 index 0000000..241760f Binary files /dev/null and b/Textures/Womb_old/Cum_11.png differ diff --git a/Textures/Womb_old/Cum_12.png b/Textures/Womb_old/Cum_12.png new file mode 100644 index 0000000..7872f5f Binary files /dev/null and b/Textures/Womb_old/Cum_12.png differ diff --git a/Textures/Womb_old/Cum_13.png b/Textures/Womb_old/Cum_13.png new file mode 100644 index 0000000..3bae9d9 Binary files /dev/null and b/Textures/Womb_old/Cum_13.png differ diff --git a/Textures/Womb_old/Cum_14.png b/Textures/Womb_old/Cum_14.png new file mode 100644 index 0000000..0bbac57 Binary files /dev/null and b/Textures/Womb_old/Cum_14.png differ diff --git a/Textures/Womb_old/Cum_15.png b/Textures/Womb_old/Cum_15.png new file mode 100644 index 0000000..b472b16 Binary files /dev/null and b/Textures/Womb_old/Cum_15.png differ diff --git a/Textures/Womb_old/Cum_16.png b/Textures/Womb_old/Cum_16.png new file mode 100644 index 0000000..0b5a949 Binary files /dev/null and b/Textures/Womb_old/Cum_16.png differ diff --git a/Textures/Womb_old/Cum_17.png b/Textures/Womb_old/Cum_17.png new file mode 100644 index 0000000..e62bc70 Binary files /dev/null and b/Textures/Womb_old/Cum_17.png differ diff --git a/Textures/Womb_old/Empty.png b/Textures/Womb_old/Empty.png new file mode 100644 index 0000000..1aa9036 Binary files /dev/null and b/Textures/Womb_old/Empty.png differ diff --git a/Textures/Womb_old/ImplantedEgg.png b/Textures/Womb_old/ImplantedEgg.png new file mode 100644 index 0000000..a109402 Binary files /dev/null and b/Textures/Womb_old/ImplantedEgg.png differ diff --git a/Textures/Womb_old/Womb.7z b/Textures/Womb_old/Womb.7z new file mode 100644 index 0000000..9041c54 Binary files /dev/null and b/Textures/Womb_old/Womb.7z differ diff --git a/Textures/Womb_old/Womb.png b/Textures/Womb_old/Womb.png new file mode 100644 index 0000000..99cc7c9 Binary files /dev/null and b/Textures/Womb_old/Womb.png differ diff --git a/Textures/Womb_old/Womb_Bleeding.png b/Textures/Womb_old/Womb_Bleeding.png new file mode 100644 index 0000000..005c530 Binary files /dev/null and b/Textures/Womb_old/Womb_Bleeding.png differ diff --git a/Textures/Womb_old/Womb_Cum.psd b/Textures/Womb_old/Womb_Cum.psd new file mode 100644 index 0000000..8867b14 Binary files /dev/null and b/Textures/Womb_old/Womb_Cum.psd differ diff --git a/Textures/Womb_old/Womb_Cum00.png b/Textures/Womb_old/Womb_Cum00.png new file mode 100644 index 0000000..7788477 Binary files /dev/null and b/Textures/Womb_old/Womb_Cum00.png differ diff --git a/Textures/Womb_old/Womb_Cum01.png b/Textures/Womb_old/Womb_Cum01.png new file mode 100644 index 0000000..0538950 Binary files /dev/null and b/Textures/Womb_old/Womb_Cum01.png differ diff --git a/Textures/Womb_old/Womb_Cum02.png b/Textures/Womb_old/Womb_Cum02.png new file mode 100644 index 0000000..6cbdbef Binary files /dev/null and b/Textures/Womb_old/Womb_Cum02.png differ diff --git a/Textures/Womb_old/Womb_Cum03.png b/Textures/Womb_old/Womb_Cum03.png new file mode 100644 index 0000000..b5eb038 Binary files /dev/null and b/Textures/Womb_old/Womb_Cum03.png differ diff --git a/Textures/Womb_old/Womb_Cum04.png b/Textures/Womb_old/Womb_Cum04.png new file mode 100644 index 0000000..cf3331c Binary files /dev/null and b/Textures/Womb_old/Womb_Cum04.png differ diff --git a/Textures/Womb_old/Womb_Cum05.png b/Textures/Womb_old/Womb_Cum05.png new file mode 100644 index 0000000..d6c211e Binary files /dev/null and b/Textures/Womb_old/Womb_Cum05.png differ diff --git a/Textures/Womb_old/Womb_Cum06.png b/Textures/Womb_old/Womb_Cum06.png new file mode 100644 index 0000000..1a4c741 Binary files /dev/null and b/Textures/Womb_old/Womb_Cum06.png differ diff --git a/Textures/Womb_old/Womb_Cum07.png b/Textures/Womb_old/Womb_Cum07.png new file mode 100644 index 0000000..17c9eed Binary files /dev/null and b/Textures/Womb_old/Womb_Cum07.png differ diff --git a/Textures/Womb_old/Womb_Cum08.png b/Textures/Womb_old/Womb_Cum08.png new file mode 100644 index 0000000..b2c785f Binary files /dev/null and b/Textures/Womb_old/Womb_Cum08.png differ diff --git a/Textures/Womb_old/Womb_Cum09.png b/Textures/Womb_old/Womb_Cum09.png new file mode 100644 index 0000000..d90fcbc Binary files /dev/null and b/Textures/Womb_old/Womb_Cum09.png differ diff --git a/Textures/Womb_old/Womb_Cum10.png b/Textures/Womb_old/Womb_Cum10.png new file mode 100644 index 0000000..6405442 Binary files /dev/null and b/Textures/Womb_old/Womb_Cum10.png differ diff --git a/Textures/Womb_old/Womb_Cum11.png b/Textures/Womb_old/Womb_Cum11.png new file mode 100644 index 0000000..4708645 Binary files /dev/null and b/Textures/Womb_old/Womb_Cum11.png differ diff --git a/Textures/Womb_old/Womb_Cum12.png b/Textures/Womb_old/Womb_Cum12.png new file mode 100644 index 0000000..de7a045 Binary files /dev/null and b/Textures/Womb_old/Womb_Cum12.png differ diff --git a/Textures/Womb_old/Womb_Cum13.png b/Textures/Womb_old/Womb_Cum13.png new file mode 100644 index 0000000..f085f10 Binary files /dev/null and b/Textures/Womb_old/Womb_Cum13.png differ diff --git a/Textures/Womb_old/Womb_Cum14.png b/Textures/Womb_old/Womb_Cum14.png new file mode 100644 index 0000000..25a94d7 Binary files /dev/null and b/Textures/Womb_old/Womb_Cum14.png differ diff --git a/Textures/Womb_old/Womb_Cum15.png b/Textures/Womb_old/Womb_Cum15.png new file mode 100644 index 0000000..995ae80 Binary files /dev/null and b/Textures/Womb_old/Womb_Cum15.png differ diff --git a/Textures/Womb_old/Womb_Cum16.png b/Textures/Womb_old/Womb_Cum16.png new file mode 100644 index 0000000..5c70d4d Binary files /dev/null and b/Textures/Womb_old/Womb_Cum16.png differ diff --git a/Textures/Womb_old/Womb_Cum17.png b/Textures/Womb_old/Womb_Cum17.png new file mode 100644 index 0000000..0687db2 Binary files /dev/null and b/Textures/Womb_old/Womb_Cum17.png differ diff --git a/Textures/Womb_old/Womb_Implanted.png b/Textures/Womb_old/Womb_Implanted.png new file mode 100644 index 0000000..33b72cc Binary files /dev/null and b/Textures/Womb_old/Womb_Implanted.png differ diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation.sln b/source - 복사본/RJW_Menstruation/RJW_Menstruation.sln new file mode 100644 index 0000000..99c2de2 --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30907.101 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RJW_Menstruation", "RJW_Menstruation\RJW_Menstruation.csproj", "{0E3D82EC-3048-43DC-8C7A-6377671928FA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0E3D82EC-3048-43DC-8C7A-6377671928FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E3D82EC-3048-43DC-8C7A-6377671928FA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E3D82EC-3048-43DC-8C7A-6377671928FA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E3D82EC-3048-43DC-8C7A-6377671928FA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0E4B1D09-2A81-4440-AC1E-32ACCECBEE0B} + EndGlobalSection +EndGlobal diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/App.config b/source - 복사본/RJW_Menstruation/RJW_Menstruation/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Configurations.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Configurations.cs new file mode 100644 index 0000000..c765e78 --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Configurations.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; + +namespace RJW_Menstruation +{ + public class Configurations : ModSettings + { + public static readonly float ImplantationChanceDefault = 0.25f; + public static readonly int ImplantationChanceAdjustDefault = 25; + public static readonly float FertilizeChanceDefault = 0.05f; + public static readonly int FertilizeChanceAdjustDefault = 50; + public static readonly float CumDecayRatioDefault = 0.05f; + public static readonly int CumDecayRatioAdjustDefault = 50; + public static readonly float CumFertilityDecayRatioDefault = 0.2f; + public static readonly int CumFertilityDecayRatioAdjustDefault = 200; + public static readonly int CycleAccelerationDefault = 6; + + public static float ImplantationChance = ImplantationChanceDefault; + public static int ImplantationChanceAdjust = ImplantationChanceAdjustDefault; + public static float FertilizeChance = FertilizeChanceDefault; + public static int FertilizeChanceAdjust = FertilizeChanceAdjustDefault; + public static float CumDecayRatio = CumDecayRatioDefault; + public static int CumDecayRatioAdjust = CumDecayRatioAdjustDefault; + public static float CumFertilityDecayRatio = CumFertilityDecayRatioDefault; + public static int CumFertilityDecayRatioAdjust = CumFertilityDecayRatioAdjustDefault; + public static int CycleAcceleration = CycleAccelerationDefault; + public static bool EnableWombIcon = true; + public static bool EnableAnimalCycle = false; + public static bool Debug = false; + + public override void ExposeData() + { + Scribe_Values.Look(ref ImplantationChanceAdjust, "ImplantationChanceAdjust", ImplantationChanceAdjust, true); + Scribe_Values.Look(ref ImplantationChance, "ImplantationChance", ImplantationChance, true); + Scribe_Values.Look(ref FertilizeChanceAdjust, "FertilizeChanceAdjust", FertilizeChanceAdjust, true); + Scribe_Values.Look(ref FertilizeChance, "FertilizeChance", FertilizeChance, true); + Scribe_Values.Look(ref CumDecayRatioAdjust, "CumDecayRatioAdjust", CumDecayRatioAdjust, true); + Scribe_Values.Look(ref CumDecayRatio, "CumDecayRatio", CumDecayRatio, true); + Scribe_Values.Look(ref CumFertilityDecayRatioAdjust, "CumFertilityDecayRatioAdjust", CumFertilityDecayRatioAdjust, true); + Scribe_Values.Look(ref CumFertilityDecayRatio, "CumFertilityDecayRatio", CumFertilityDecayRatio, true); + Scribe_Values.Look(ref EnableWombIcon, "EnableWombIcon", EnableWombIcon, true); + Scribe_Values.Look(ref EnableAnimalCycle, "EnableAnimalCycle", EnableAnimalCycle, true); + base.ExposeData(); + } + + + } + + + public class RJW_Menstruation : Mod + { + + private readonly Configurations config; + public RJW_Menstruation(ModContentPack content) : base(content) + { + config = GetSettings(); + + } + + public override string SettingsCategory() + { + return Translations.Mod_Title; + } + + public override void DoSettingsWindowContents(Rect inRect) + { + Rect mainRect = inRect.ContractedBy(20f); + Listing_Standard listmain = new Listing_Standard(); + listmain.Begin(mainRect); + + listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc); + + listmain.CheckboxLabeled(Translations.Option2_Label, ref Configurations.EnableAnimalCycle, Translations.Option2_Desc); + + listmain.Label(Translations.Option3_Label + " " + Configurations.ImplantationChance*100 + "%", -1, Translations.Option3_Desc); + Configurations.ImplantationChanceAdjust = (int)listmain.Slider(Configurations.ImplantationChanceAdjust, 0, 1000); + Configurations.ImplantationChance = (float)Configurations.ImplantationChanceAdjust/100; + + listmain.Label(Translations.Option4_Label + " " + Configurations.FertilizeChance*100 + "%", -1, Translations.Option4_Desc); + Configurations.FertilizeChanceAdjust = (int)listmain.Slider(Configurations.FertilizeChanceAdjust, 0, 1000); + Configurations.FertilizeChance = (float)Configurations.FertilizeChanceAdjust/1000; + + listmain.Label(Translations.Option5_Label + " " + Configurations.CumDecayRatio*100 + "%", -1, Translations.Option5_Desc); + Configurations.CumDecayRatioAdjust = (int)listmain.Slider(Configurations.CumDecayRatioAdjust, 0, 1000); + Configurations.CumDecayRatio = (float)Configurations.CumDecayRatioAdjust/1000; + + listmain.Label(Translations.Option6_Label + " " + Configurations.CumFertilityDecayRatio*100 + "%", -1, Translations.Option6_Desc); + Configurations.CumFertilityDecayRatioAdjust = (int)listmain.Slider(Configurations.CumFertilityDecayRatioAdjust, 0, 1000); + Configurations.CumFertilityDecayRatio = (float)Configurations.CumFertilityDecayRatioAdjust/1000; + + listmain.Label(Translations.Option7_Label + " x" + Configurations.CycleAcceleration, -1, Translations.Option7_Desc); + Configurations.CycleAcceleration = (int)listmain.Slider(Configurations.CycleAcceleration,1,50); + + + listmain.CheckboxLabeled(Translations.Option8_Label, ref Configurations.Debug, Translations.Option8_Desc); + if (listmain.ButtonText("reset to default")) + { + Configurations.ImplantationChanceAdjust = Configurations.ImplantationChanceAdjustDefault; + Configurations.FertilizeChanceAdjust = Configurations.FertilizeChanceAdjustDefault; + Configurations.CumDecayRatioAdjust = Configurations.CumDecayRatioAdjustDefault; + Configurations.CumFertilityDecayRatioAdjust = Configurations.CumFertilityDecayRatioAdjustDefault; + Configurations.EnableWombIcon = true; + Configurations.EnableAnimalCycle = false; + Configurations.CycleAcceleration = Configurations.CycleAccelerationDefault; + } + + + listmain.End(); + + + } + + + } + + + + +} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Cum.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Cum.cs new file mode 100644 index 0000000..3fbb33f --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Cum.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using UnityEngine; +using rjw; + +namespace RJW_Menstruation +{ + public class Cum : IExposable + { + public Pawn pawn; + + //public bool failedFertilization = false; + //public bool dead = false; + public float volume; // ml + public float fertvolume; + public float fertFactor = 1.0f; + public bool notcum = false; // for other fluids + public string notcumLabel = ""; + private bool useCustomColor = false; + private float notcumthickness = 0; + public float decayresist + { + get + { + if (!notcum) return DNA.cumTickness; + else return notcumthickness; + } + set + { + notcumthickness = value; + } + } + private Color customColor; + public DNADef DNA + { + get + { + if (DNAcache == null) + { + DNAcache = DefDatabase.GetNamedSilentFail(pawn.def.defName); + if (DNAcache == null) + { + DNAcache = VariousDefOf.defaultDNA; + } + return DNAcache; + } + else return DNAcache; + } + } + private DNADef DNAcache = null; + public ThingDef FilthDef + { + get + { + if (filthDef == null) return VariousDefOf.CumFilth; + else return filthDef; + } + set + { + filthDef = value; + } + } + private ThingDef filthDef = null; + public Color color + { + get + { + if (!useCustomColor) return DNA.CumColor; + else return customColor; + } + + set + { + useCustomColor = true; + customColor = value; + } + } + + + public Cum() {} + + public Cum(Pawn pawn) + { + this.pawn = pawn; + volume = 1.0f; + fertvolume = 1.0f; + decayresist = 0; + } + + public Cum(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthDef = null) + { + this.pawn = pawn; + this.volume = volume; + this.fertvolume = volume; + this.notcum = true; + this.notcumLabel = notcumlabel; + this.notcumthickness = decayresist; + this.filthDef = filthDef; + } + + public Cum(Pawn pawn, float volume, float fertility, ThingDef filthDef = null) + { + this.pawn = pawn; + this.volume = volume; + if (fertility > 0) + { + this.fertvolume = volume; + this.fertFactor = fertility; + } + else this.fertvolume = 0; + this.filthDef = filthDef; + } + + + + public void ExposeData() + { + Scribe_References.Look(ref pawn, "pawn", true); + Scribe_Values.Look(ref volume, "volume", volume, true); + Scribe_Values.Look(ref fertvolume, "fertvolume", fertvolume, true); + Scribe_Values.Look(ref notcumthickness, "notcumthickness", notcumthickness, true); + Scribe_Values.Look(ref fertFactor, "fertFactor", fertFactor, true); + Scribe_Values.Look(ref notcum, "notcum", notcum, true); + Scribe_Values.Look(ref notcumLabel, "notcumLabel", notcumLabel, true); + Scribe_Values.Look(ref useCustomColor, "useCustomColor", useCustomColor, true); + Scribe_Values.Look(ref customColor, "customColor", customColor, true); + + } + } + + + + + + +} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/DNADef.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/DNADef.cs new file mode 100644 index 0000000..5f19368 --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/DNADef.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using UnityEngine; + + +namespace RJW_Menstruation +{ + public class DNADef : Def + { + public bool IsNone => string.IsNullOrEmpty(defName); + public static readonly DNADef None = new DNADef(); + + public string fetusTexPath; + public ColorInt cumColor; + public Color CumColor => cumColor.ToColor; + public float cumTickness = 0f; + + } + + + +} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Dialog_WombStatus.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Dialog_WombStatus.cs new file mode 100644 index 0000000..6ed4294 --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Dialog_WombStatus.cs @@ -0,0 +1,204 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; +using RimWorld; +using rjw; + +namespace RJW_Menstruation +{ + public class Dialog_WombStatus : Window + { + private Pawn pawn; + private HediffComp_Menstruation comp; + private const float windowMargin = 20f; + private const float pawnRectWidth = 150f; + private const float pawnRectHeight = 150f; + private const float wombRectHeight = 270f; + private const float wombRectWidth = 300f; + private const float fontheight = 30; + private const float genitalRectWidth = 102; + private const float genitalRectHeight = 140; + + + private Texture2D womb; + private Texture2D cum; + private Texture2D vagina; + private Texture2D anal; + private Color cumcolor; + + public override Vector2 InitialSize + { + get + { + return new Vector2(300f + 2*windowMargin,800f); + } + } + + public Dialog_WombStatus(Pawn pawn, HediffComp_Menstruation comp, Texture2D icon) + { + this.pawn = pawn; + this.comp = comp; + womb = icon; + } + + public override void DoWindowContents(Rect inRect) + { + bool flag = false; + soundClose = SoundDefOf.InfoCard_Close; + //closeOnClickedOutside = true; + absorbInputAroundWindow = false; + forcePause = false; + preventCameraMotion = false; + draggable = true; + //resizeable = true; + + if (Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.Escape)) + { + flag = true; + Event.current.Use(); + } + + Rect windowRect = inRect.ContractedBy(windowMargin); + Rect mainRect = new Rect(windowRect.x, windowRect.y, windowRect.width, windowRect.height - 20f); + Rect closeRect = new Rect(windowRect.xMax, 0f, 20f, 20f); + MainContents(mainRect); + if (Widgets.CloseButtonFor(closeRect)) + { + Close(); + } + } + + private void MainContents(Rect mainRect) + { + GUIStyle fontstylecenter = new GUIStyle() { alignment = TextAnchor.MiddleCenter }; + GUIStyle fontstyleright = new GUIStyle() { alignment = TextAnchor.MiddleRight }; + GUIStyle fontstyleleft = new GUIStyle() { alignment = TextAnchor.MiddleLeft }; + GUIStyle boxstyle = new GUIStyle(GUI.skin.textArea); + GUIStyle buttonstyle = new GUIStyle(GUI.skin.button); + boxstyle.hover = boxstyle.normal; + boxstyle.onHover = boxstyle.normal; + boxstyle.onNormal = boxstyle.normal; + + buttonstyle.onHover = buttonstyle.onNormal; + buttonstyle.hover = buttonstyle.normal; + boxstyle.border.left = 4; boxstyle.border.right = 4; boxstyle.border.bottom = 4; boxstyle.border.top = 4; + + float preginfoheight = 0f; + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + if (pawn.IsPregnant()) + { + womb = Utility.GetPregnancyIcon(comp, hediff); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + if (h.GestationProgress < 0.2f) cum = Utility.GetCumIcon(comp); + else cum = ContentFinder.Get(("Womb/Empty"), true); + Pawn fetus = Utility.GetFetus(pawn); + preginfoheight = fontheight; + Rect preginfo = new Rect(0f, mainRect.yMax - wombRectHeight - 2, wombRectWidth, preginfoheight); + if (fetus != null) + { + fontstyleright.normal.textColor = Color.white; + buttonstyle.alignment = TextAnchor.MiddleLeft; + GUI.Box(preginfo, h.babies.Count + " " + fetus.def.label + " " + Translations.Dialog_WombInfo02, buttonstyle); + GUI.Label(preginfo, Translations.Dialog_WombInfo03 + ": " + h.father.LabelShort + " ", fontstyleright); + } + + } + else cum = ContentFinder.Get(("Womb/Empty"), true); + } + else + { + womb = Utility.GetWombIcon(comp); + cum = Utility.GetCumIcon(comp); + } + + + Rect pawnRect = new Rect(0, 0, pawnRectWidth, pawnRectHeight); + Widgets.DrawTextureFitted(pawnRect,PortraitsCache.Get(pawn, pawnRect.size),1.0f); + Rect pawnLabelRect = new Rect(0, pawnRectHeight, pawnRectWidth, fontheight-10); + Rect pawnLabel2Rect = new Rect(0, pawnRectHeight+fontheight-10, pawnRectWidth, fontheight-10); + fontstylecenter.normal.textColor = pawn.DrawColor; + GUI.Label(pawnLabelRect, pawn.Name.ToStringFull, fontstylecenter); + GUI.Label(pawnLabel2Rect, pawn.story.Title, fontstylecenter); + GUI.color = Color.white; + + + Rect wombInfoRect = new Rect(0f, mainRect.yMax - wombRectHeight - fontheight - 2, wombRectWidth, fontheight); + + buttonstyle.normal.textColor = Color.white; + //boxstyle.normal.background = Texture2D.whiteTexture; + buttonstyle.alignment = TextAnchor.MiddleLeft; + GUI.backgroundColor = new Color(0.24f, 0.29f, 0.35f, 1); + GUI.Box(wombInfoRect, Translations.Dialog_WombInfo01 + ": " + comp.GetCurStageLabel,buttonstyle); + GUI.color = Color.white; + + + fontstyleright.normal.textColor = Color.red; + if (comp.GetFertilization) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo05 + " ", fontstyleright); + else if (comp.GetEggFertilizing) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo06 + " ", fontstyleright); + else if (comp.GetEgg) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo07 + " ", fontstyleright); + + //Widgets.Label(wombInfoRect,Translations.Dialog_WombInfo01 + ": " + comp.GetCurStageLabel); + + + cumcolor = comp.GetCumMixtureColor; + Rect wombRect = new Rect(0f, mainRect.yMax - wombRectHeight + preginfoheight, wombRectWidth, wombRectHeight); + GUI.color = new Color(1.00f,0.47f,0.47f,1); + GUI.Box(wombRect,"",boxstyle); + //GUI.color = Color.white; + //Widgets.DrawTextureFitted(wombRect, womb,1.0f); + //GUI.color = cumcolor; + //Widgets.DrawTextureFitted(wombRect, cum,1.0f); + GUI.DrawTexture(wombRect, womb, ScaleMode.ScaleToFit, true, 0, Color.white, 0, 0); + GUI.DrawTexture(wombRect, cum, ScaleMode.ScaleToFit, true, 0, cumcolor,0,0); + GUI.color = Color.white; + + Rect cumlistTitle = new Rect(pawnRectWidth, 0, wombRectWidth - pawnRectWidth, fontheight); + GUI.Label(cumlistTitle,Translations.Dialog_WombInfo04); + + Rect cumlistRect = new Rect(pawnRectWidth, fontheight, wombRectWidth - pawnRectWidth, mainRect.yMax - wombRectHeight - fontheight); + Listing_Standard cumlist = new Listing_Standard + { + maxOneColumn = true, + ColumnWidth = wombRectWidth - pawnRectWidth + }; + cumlist.Begin(cumlistRect); + Listing_Standard cumlistsection = cumlist.BeginSection_NewTemp(mainRect.yMax - wombRectHeight - 2 * fontheight - 12f); + foreach(string s in comp.GetCumsInfo) + { + cumlistsection.Label(s); + } + cumlist.EndSection(cumlistsection); + cumlist.End(); + + Rect genitalRect = new Rect(24, pawnRectHeight + 2*fontheight, genitalRectWidth, genitalRectHeight + fontheight*2); + Rect genitalIconRect = new Rect(genitalRect.x,genitalRect.y + fontheight ,genitalRectWidth,genitalRectHeight); + Rect genitalVaginaLabelRect = new Rect(genitalRect.x,genitalRect.y,genitalRectWidth,fontheight); + Rect genitalAnusLabelRect = new Rect(genitalRect.x,genitalRect.y + fontheight +genitalRectHeight ,genitalRectWidth,fontheight); + + vagina = Utility.GetGenitalIcon(pawn); + anal = Utility.GetAnalIcon(pawn); + GUI.color = new Color(1.00f, 0.47f, 0.47f, 1); + GUI.Box(genitalRect, "", boxstyle); + GUI.color = pawn.story.SkinColor; + //Widgets.DrawTextureFitted(genitalIconRect, anal, 1.0f); + //Widgets.DrawTextureFitted(genitalIconRect, vagina, 1.0f); + GUI.DrawTexture(genitalIconRect, anal, ScaleMode.ScaleToFit); + GUI.DrawTexture(genitalIconRect, vagina, ScaleMode.ScaleToFit); + + GUI.color = Color.white; + GUI.Label(genitalVaginaLabelRect, Utility.GetVaginaLabel(pawn),fontstylecenter); + GUI.Label(genitalAnusLabelRect, Utility.GetAnusLabel(pawn),fontstylecenter); + + } + + + + + } +} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs new file mode 100644 index 0000000..5f5e314 --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RimWorld; +using Verse; + +namespace RJW_Menstruation +{ + public class FertPillOutcomDoer : IngestionOutcomeDoer + { + protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested) + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn); + if (comp.curStage.Equals(HediffComp_Menstruation.Stage.Follicular) || comp.curStage.Equals(HediffComp_Menstruation.Stage.Luteal)) comp.curStage = HediffComp_Menstruation.Stage.Ovulatory; + } + } + + +} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/GetGizmos.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/GetGizmos.cs new file mode 100644 index 0000000..cc884c7 --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/GetGizmos.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using HarmonyLib; +using Verse; +using RimWorld; +using rjw; +using UnityEngine; +using Verse.Sound; + +namespace RJW_Menstruation +{ + [HarmonyPatch(typeof(Pawn), "GetGizmos")] + public class Pawn_GetGizmos + { + public static void Postfix(ref IEnumerable __result, Pawn __instance) + { + List gizmoList = __result.ToList(); + bool isCreatureMine = __instance.Faction != null && (__instance.Faction.IsPlayer || __instance.IsPrisonerOfColony); + + if (!isCreatureMine) + { + return; + } + + if (Configurations.EnableWombIcon && __instance.gender == Gender.Female) + { + if (!__instance.IsAnimal()) + { + AddWombGizmos(__instance, ref gizmoList); + } + else if (Configurations.EnableAnimalCycle) + { + AddWombGizmos(__instance, ref gizmoList); + } + + } + + + + + __result = gizmoList; + } + + + private static void AddWombGizmos(Pawn __instance, ref List gizmoList) + { + gizmoList.Add(CreateGizmo_WombStatus(__instance)); + } + + private static Gizmo CreateGizmo_WombStatus(Pawn pawn) + { + HediffComp_Menstruation comp = pawn.health.hediffSet.GetFirstHediffOfDef(Genital_Helper.average_vagina).TryGetComp(); + Texture2D icon,icon_overay; + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + string description = ""; + if (Configurations.Debug) description += comp.curStage + ": " + comp.curStageHrs + "\n" + "fertcums: " + comp.TotalFertCum; + else description += comp.GetCurStageLabel + "\n"; + if (pawn.IsPregnant()) + { + icon = Utility.GetPregnancyIcon(comp,hediff); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + if (h.GestationProgress < 0.2f) icon_overay = Utility.GetCumIcon(comp); + else icon_overay = ContentFinder.Get(("Womb/Empty"), true); + } + else icon_overay = ContentFinder.Get(("Womb/Empty"), true); + } + else + { + icon = Utility.GetWombIcon(comp); + icon_overay = Utility.GetCumIcon(comp); + } + foreach (string s in comp.GetCumsInfo) description += s + "\n"; + + Color c = comp.GetCumMixtureColor; + + Gizmo gizmo = new Gizmo_Womb + { + defaultLabel = pawn.LabelShort, + defaultDesc = description, + icon = icon, + icon_overay = icon_overay, + cumcolor = c, + order = 100, + action = delegate + { + SoundDefOf.InfoCard_Open.PlayOneShotOnCamera(); + Find.WindowStack.Add(new Dialog_WombStatus(pawn, comp,icon)); + } + }; + return gizmo; + } + } + + + + + + +} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Gizmo_Womb.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Gizmo_Womb.cs new file mode 100644 index 0000000..e91f20f --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Gizmo_Womb.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using UnityEngine; +using Verse.Sound; + +namespace RJW_Menstruation +{ + public class Gizmo_Womb : Command_Action + { + public Texture2D icon_overay; + public Color cumcolor; + + protected override void DrawIcon(Rect rect, Material buttonMat = null) + { + Texture2D badTex = icon; + Texture2D overay = icon_overay; + Color color = cumcolor; + + if (badTex == null) + { + badTex = BaseContent.BadTex; + } + if (overay == null) + { + overay = BaseContent.BadTex; + } + if (color == null) color = Color.white; + rect.position += new Vector2(iconOffset.x * rect.size.x, iconOffset.y * rect.size.y); + GUI.color = IconDrawColor; + Widgets.DrawTextureFitted(rect, badTex, this.iconDrawScale * 0.85f, this.iconProportions, this.iconTexCoords, this.iconAngle, buttonMat); + GUI.color = color; + Widgets.DrawTextureFitted(rect, overay, iconDrawScale * 0.85f, iconProportions, iconTexCoords, iconAngle, buttonMat); + GUI.color = Color.white; + } + + + + + } +} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Harmony.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Harmony.cs new file mode 100644 index 0000000..6e3171c --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Harmony.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Reflection; +using HarmonyLib; +using Verse; +using RimWorld; +using rjw; + +namespace RJW_Menstruation +{ + [StaticConstructorOnStartup] + internal static class First + { + static First() + { + var har = new Harmony("LL"); + har.PatchAll(Assembly.GetExecutingAssembly()); + } + } + + + + +} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs new file mode 100644 index 0000000..4737ac4 --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs @@ -0,0 +1,780 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using HugsLib; +using rjw; +using UnityEngine; + +namespace RJW_Menstruation +{ + public class CompProperties_Menstruation : HediffCompProperties + { + public float maxCumCapacity; // ml + public float baseImplantationChanceFactor; + public float basefertilizationChanceFactor; + public float deviationFactor; + public int folicularIntervalDays = 14; //before ovulation including beginning of bleeding + public int lutealIntervalDays = 14; //after ovulation until bleeding + public int bleedingIntervalDays = 6; //must be less than folicularIntervalDays + public int recoveryIntervalDays = 10; //additional infertile days after gave birth + public int eggLifespanDays = 2; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday + public string wombTex = "Womb/Womb"; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday + + + public CompProperties_Menstruation() + { + + compClass = typeof(HediffComp_Menstruation); + } + } + + + public class HediffComp_Menstruation : HediffComp + { + const float minmakefilthvalue = 1.0f; + + public static readonly int tickInterval = 2500; // an hour + public CompProperties_Menstruation Props; + public Stage curStage = Stage.Follicular; + public int curStageHrs = 0; + + public enum Stage + { + Follicular, + Ovulatory, + Luteal, + Bleeding, + Fertilized, + Pregnant, + Recover + } + + private List cums; + private bool loaded = false; + private List eggs; + private int follicularIntervalhours = -1; + private int lutealIntervalhours = -1; + private int bleedingIntervalhours = -1; + private int recoveryIntervalhours = -1; + private Action actionref; + + public float TotalCum + { + get + { + float res = 0; + if (cums.NullOrEmpty()) return 0; + foreach (Cum cum in cums) + { + res += cum.volume; + } + return res; + } + } + public float TotalFertCum + { + get + { + float res = 0; + if (cums.NullOrEmpty()) return 0; + foreach (Cum cum in cums) + { + if (!cum.notcum) res += cum.fertvolume; + } + return res; + } + } + public float TotalCumPercent + { + get + { + float res = 0; + if (cums.NullOrEmpty()) return 0; + foreach (Cum cum in cums) + { + res += cum.volume; + } + return res/ Props.maxCumCapacity; + } + } + public float CumCapacity + { + get + { + float res = Props.maxCumCapacity; + if (curStage == Stage.Pregnant) res *= 0.2f; + return res; + } + } + public float CumInFactor + { + get + { + float res = 1.0f; + if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) res = 0.001f; + return res; + } + } + //make follicular interval into half and double egg lifespan + public float CycleFactor + { + get + { + if (xxx.has_quirk(parent.pawn, "Breeder")) return 0.5f; + + return 1.0f; + } + } + //effect on implant chance + public float ImplantFactor + { + get + { + float factor = 1.0f; + if (xxx.has_quirk(parent.pawn, "Breeder")) factor = 10.0f; + if (xxx.is_animal(parent.pawn)) factor *= RJWPregnancySettings.animal_impregnation_chance/100f; + else factor *= RJWPregnancySettings.humanlike_impregnation_chance/100f; + return parent.pawn.health.capacities.GetLevel(xxx.reproduction) * factor; + } + } + public IEnumerable GetCumsInfo + { + get + { + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (!cum.notcum) yield return String.Format(cum.pawn.Label + ": {0:0.##}ml", cum.volume); + else yield return String.Format(cum.notcumLabel + ": {0:0.##}ml", cum.volume); + } + else yield return Translations.Info_noCum; + } + } + public Color GetCumMixtureColor + { + get + { + Color mixedcolor = Color.white; + + if (!cums.NullOrEmpty()) + { + float mixedsofar = 0; + foreach (Cum cum in cums) + { + mixedcolor = Color.LerpUnclamped(mixedcolor, cum.color, cum.volume/(mixedsofar + cum.volume)); + mixedsofar += cum.volume; + } + } + return mixedcolor; + } + } + public string GetCurStageLabel + { + get + { + switch (curStage) + { + case Stage.Follicular: + return Translations.Stage_Follicular; + case Stage.Ovulatory: + return Translations.Stage_Ovulatory; + case Stage.Luteal: + return Translations.Stage_Luteal; + case Stage.Bleeding: + return Translations.Stage_Bleeding; + case Stage.Fertilized: + return Translations.Stage_Fertilized; + case Stage.Pregnant: + return Translations.Stage_Pregnant; + case Stage.Recover: + return Translations.Stage_Recover; + default: + return ""; + } + } + + } + public bool GetEggFertilizing + { + get + { + if (!eggs.NullOrEmpty()) + { + if (!cums.NullOrEmpty()) foreach(Cum cum in cums) + { + if (cum.fertvolume > 0) return true; + } + return false; + + } + else return false; + } + } + public bool GetFertilization + { + get + { + if (!eggs.NullOrEmpty()) foreach(Egg egg in eggs) + { + if (egg.fertilized) return true; + } + return false; + } + } + public bool GetEgg + { + get + { + return !eggs.NullOrEmpty(); + } + } + + + public override void CompExposeData() + { + base.CompExposeData(); + Scribe_Collections.Look(ref cums, saveDestroyedThings: true, label: "cums", lookMode: LookMode.Deep, ctorArgs: new object[0]); + Scribe_Collections.Look(ref eggs, saveDestroyedThings: true, label: "eggs", lookMode: LookMode.Deep, ctorArgs: new object[0]); + Scribe_Values.Look(ref curStage, "curStage", curStage, true); + Scribe_Values.Look(ref curStageHrs, "curStageHrs", curStageHrs, true); + Scribe_Values.Look(ref follicularIntervalhours, "follicularIntervalhours", follicularIntervalhours, true); + Scribe_Values.Look(ref lutealIntervalhours, "lutealIntervalhours", lutealIntervalhours, true); + Scribe_Values.Look(ref bleedingIntervalhours, "bleedingIntervalhours", bleedingIntervalhours, true); + Scribe_Values.Look(ref recoveryIntervalhours, "recoveryIntervalhours", recoveryIntervalhours, true); + + + } + + public override void CompPostTick(ref float severityAdjustment) + { + if (!loaded) + { + Props = (CompProperties_Menstruation)props; + if (follicularIntervalhours < 0) + { + follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24,Props.deviationFactor); + curStage = RandomStage(); + } + + if (lutealIntervalhours < 0) lutealIntervalhours = PeriodRandomizer(Props.lutealIntervalDays*24, Props.deviationFactor); + if (bleedingIntervalhours < 0) bleedingIntervalhours = PeriodRandomizer(Props.bleedingIntervalDays*24, Props.deviationFactor); + if (recoveryIntervalhours < 0) recoveryIntervalhours = PeriodRandomizer(Props.recoveryIntervalDays * 24, Props.deviationFactor); + if (cums == null) cums = new List(); + if (eggs == null) eggs = new List(); + if (parent.pawn.IsPregnant()) curStage = Stage.Pregnant; + if (Configurations.EnableAnimalCycle) + { + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false); + } + else if (!parent.pawn.IsAnimal()) HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false); + loaded = true; + } + } + + public override void CompPostPostRemoved() + { + HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(actionref); + ModLog.Message(parent.pawn.Label + "tick scheduler removed"); + base.CompPostPostRemoved(); + } + + + public Cum GetNotCum(string notcumlabel) + { + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.notcum && cum.notcumLabel.Equals(notcumlabel)) return cum; + } + return null; + } + + public Cum GetCum(Pawn pawn) + { + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (!cum.notcum && cum.pawn.Equals(pawn)) return cum; + } + return null; + } + + + + public void CumIn(Pawn pawn, float injectedvolume, float fertility = 1.0f, ThingDef filthdef = null) + { + float volume = injectedvolume * CumInFactor; + float tmp = TotalCum + volume; + if (tmp > Props.maxCumCapacity) + { + float cumoutrate = 1 - (Props.maxCumCapacity / tmp); + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.pawn.Equals(pawn)) + { + cum.volume += volume; + cum.fertvolume += volume; + cum.FilthDef = filthdef; + merged = true; + } + cum.volume *= 1 - cumoutrate; + cum.fertvolume *= 1 - cumoutrate; + } + if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate),fertility, filthdef)); + } + else + { + + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.pawn.Equals(pawn)) + { + cum.volume += volume; + cum.fertvolume += volume; + cum.FilthDef = filthdef; + merged = true; + } + } + if (!merged) cums.Add(new Cum(pawn, volume, fertility, filthdef)); + } + } + + public void CumIn(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthdef = null) + { + float tmp = TotalCum + volume; + if (tmp > Props.maxCumCapacity) + { + float cumoutrate = 1 - (Props.maxCumCapacity / tmp); + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.notcum && cum.pawn.Equals(pawn) && cum.notcumLabel.Equals(notcumlabel)) + { + cum.volume += volume; + cum.decayresist = decayresist; + cum.fertvolume = 0; + cum.FilthDef = filthdef; + merged = true; + } + cum.volume *= 1 - cumoutrate; + cum.fertvolume *= 1 - cumoutrate; + } + if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate), notcumlabel,decayresist, filthdef)); + } + else + { + + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.notcum && cum.pawn.Equals(pawn) && cum.notcumLabel.Equals(notcumlabel)) + { + cum.volume += volume; + cum.decayresist = decayresist; + cum.fertvolume = 0; + cum.FilthDef = filthdef; + merged = true; + } + } + if (!merged) cums.Add(new Cum(pawn, volume, notcumlabel,decayresist, filthdef)); + } + } + + + public void CumOut() + { + if (cums.NullOrEmpty()) return; + List removecums = new List(); + foreach(Cum cum in cums) + { + float vd = cum.volume; + cum.volume *= Math.Max(0,(1 - (Configurations.CumDecayRatio * (1 - cum.decayresist)))); + cum.fertvolume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist))) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist)))); + if (vd - cum.volume > minmakefilthvalue) MakeCumFilth(cum); + if (cum.fertvolume < 0.01f) cum.fertvolume = 0; + if (cum.volume < 0.01f) removecums.Add(cum); + } + foreach(Cum cum in removecums) + { + cums.Remove(cum); + } + removecums.Clear(); + } + + public float CumOut(Cum targetcum, float portion = 0.1f) + { + if (cums.NullOrEmpty()) return 0; + float outcum = 0; + List removecums = new List(); + foreach (Cum cum in cums) + { + float vd = cum.volume; + if (cum.Equals(targetcum)) outcum = cum.volume * (portion * (1 - cum.decayresist)); + cum.volume *= Math.Max(0, 1 - (portion * (1 - cum.decayresist))); + cum.fertvolume *= Math.Max(0, (1 - (portion * (1 - cum.decayresist))) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist)))); + if (vd-cum.volume > minmakefilthvalue) MakeCumFilth(cum); + if (cum.fertvolume < 0.01f) cum.fertvolume = 0; + if (cum.volume < 0.01f) removecums.Add(cum); + } + foreach (Cum cum in removecums) + { + cums.Remove(cum); + } + removecums.Clear(); + return outcum; + } + + //ignores cum.decayresist + public float CumOutForce(Cum targetcum, float portion = 0.1f) + { + if (cums.NullOrEmpty()) return 0; + float outcum = 0; + List removecums = new List(); + foreach (Cum cum in cums) + { + float vd = cum.volume; + if (cum.Equals(targetcum)) outcum = cum.volume * (portion); + cum.volume *= 1 - (portion); + cum.fertvolume *= (1 - (portion)) * (1 - (Configurations.CumFertilityDecayRatio)); + if (vd - cum.volume > minmakefilthvalue) MakeCumFilth(cum); + if (cum.fertvolume < 0.01f) cum.fertvolume = 0; + if (cum.volume < 0.1f) removecums.Add(cum); + } + foreach (Cum cum in removecums) + { + cums.Remove(cum); + } + removecums.Clear(); + return outcum; + } + + + public bool FertilizationCheck() + { + if (!eggs.NullOrEmpty()) + { + bool onefertilized = false; + foreach (Egg egg in eggs) + { + if (!egg.fertilized) egg.fertilizer = Fertilize(); + if (egg.fertilizer != null) { + egg.fertilized = true; + onefertilized = true; + } + } + return onefertilized; + } + else return false; + } + + private Pawn Fertilize() + { + if (cums.NullOrEmpty()) return null; + foreach (Cum cum in cums) + { + float rand = Rand.Range(0.0f, 1.0f); + if (!cum.notcum && rand < cum.fertvolume * cum.fertFactor * Configurations.FertilizeChance * Props.basefertilizationChanceFactor) + { + return cum.pawn; + } + } + return null; + } + + + //for now, only one egg can be implanted + private bool Implant() + { + if (!eggs.NullOrEmpty()) + { + List deadeggs = new List(); + bool pregnant = false; + foreach(Egg egg in eggs) + { + if (!egg.fertilized) continue; + else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * Props.baseImplantationChanceFactor * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer)) + { + PregnancyHelper.PregnancyDecider(parent.pawn, egg.fertilizer); + pregnant = true; + break; + } + else deadeggs.Add(egg); + } + + if (pregnant) + { + eggs.Clear(); + deadeggs.Clear(); + return true; + } + else if (!deadeggs.NullOrEmpty()) + { + foreach (Egg egg in deadeggs) + { + eggs.Remove(egg); + } + deadeggs.Clear(); + } + } + return false; + } + + private void BleedOut() + { + //FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label); + CumIn(parent.pawn, Rand.Range(0f, 20f), Translations.Menstrual_Blood,-4.0f,ThingDefOf.Filth_Blood); + GetNotCum(Translations.Menstrual_Blood).color = Colors.blood; + } + + private void MakeCumFilth(Cum cum) + { + FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort); + } + + + + private void EggDecay() + { + List deadeggs = new List(); + foreach (Egg egg in eggs) + { + egg.lifespanhrs--; + if (egg.lifespanhrs < 0) deadeggs.Add(egg); + } + + if (!deadeggs.NullOrEmpty()) + { + foreach (Egg egg in deadeggs) + { + eggs.Remove(egg); + } + deadeggs.Clear(); + } + } + + + private Action PeriodSimulator(Enum targetstage) + { + Action action = null; + switch (targetstage) + { + case Stage.Follicular: + action = delegate + { + if (curStageHrs >= (follicularIntervalhours - bleedingIntervalhours) * CycleFactor) + { + GoNextStage(Stage.Ovulatory); + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + case Stage.Ovulatory: + action = delegate + { + eggs.Add(new Egg(Props.eggLifespanDays * 24)); + lutealIntervalhours = PeriodRandomizer(lutealIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Luteal); + }; + break; + case Stage.Luteal: + action = delegate + { + if (!eggs.NullOrEmpty()) + { + if (FertilizationCheck()) + { + GoNextStage(Stage.Fertilized); + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + } + else if (curStageHrs <= lutealIntervalhours) + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + else + { + bleedingIntervalhours = PeriodRandomizer(bleedingIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Bleeding); + } + }; + break; + case Stage.Bleeding: + action = delegate + { + if (curStageHrs >= bleedingIntervalhours) + { + follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Follicular); + } + else + { + if (curStageHrs < bleedingIntervalhours / 6) for (int i = 0; i < Configurations.CycleAcceleration; i++) BleedOut(); + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + case Stage.Fertilized: + action = delegate + { + if (curStageHrs >= 24) + { + if (Implant()) + { + GoNextStage(Stage.Pregnant); + } + else + { + GoNextStageSetHour(Stage.Luteal, 96); + } + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + case Stage.Pregnant: + action = delegate + { + if (parent.pawn.IsPregnant()) StayCurrentStageConst(Stage.Pregnant); + else GoNextStage(Stage.Recover); + }; + break; + case Stage.Recover: + action = delegate + { + if (curStageHrs >= recoveryIntervalhours) + { + follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Follicular); + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + default: + curStage = Stage.Follicular; + curStageHrs = 0; + if (follicularIntervalhours < 0) follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24, Props.deviationFactor); + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Follicular), tickInterval, parent.pawn, false); + break; + } + action += () => + { + CumOut(); + if (!eggs.NullOrEmpty()) EggDecay(); + }; + + actionref = action; + return action; + + void GoNextStage(Stage nextstage, float factor = 1.0f) + { + curStageHrs = 0; + curStage = nextstage; + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false); + } + + void GoNextStageSetHour(Stage nextstage, int hour, float factor = 1.0f) + { + curStageHrs = hour; + curStage = nextstage; + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false); + } + + void StayCurrentStage(float factor = 1.0f) + { + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), (int)(tickInterval * factor), parent.pawn, false); + } + + void StayCurrentStageConst(Stage curstage, float factor = 1.0f) + { + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curstage), (int)(tickInterval * factor), parent.pawn, false); + } + + + } + + + private int PeriodRandomizer(int intervalhours, float deviation) + { + return intervalhours + (int)(intervalhours*Rand.Range(-deviation,deviation)); + } + + private float InterspeciesImplantFactor(Pawn fertilizer) + { + if (RJWPregnancySettings.complex_interspecies) return SexUtility.BodySimilarity(parent.pawn, fertilizer); + else return RJWPregnancySettings.interspecies_impregnation_modifier; + } + + private Stage RandomStage() + { + int rand = Rand.Range(0,2); + + switch (rand) + { + case 0: + curStageHrs = Rand.Range(0, (Props.folicularIntervalDays - Props.bleedingIntervalDays) * 24); + return Stage.Follicular; + case 1: + curStageHrs = Rand.Range(0, Props.eggLifespanDays * 24); + return Stage.Luteal; + case 2: + curStageHrs = Rand.Range(0, Props.bleedingIntervalDays * 24); + return Stage.Bleeding; + default: return Stage.Follicular; + } + + + } + + + + public class Egg : IExposable + { + public bool fertilized; + public int lifespanhrs; + public Pawn fertilizer; + + public Egg() + { + fertilized = false; + lifespanhrs = 96; + fertilizer = null; + } + + public Egg(int lifespanhrs) + { + fertilized = false; + this.lifespanhrs = lifespanhrs; + fertilizer = null; + } + + public void ExposeData() + { + Scribe_References.Look(ref fertilizer, "fertilizer", true); + Scribe_Values.Look(ref fertilized, "fertilized", fertilized, true); + Scribe_Values.Look(ref lifespanhrs, "lifespanhrs", lifespanhrs, true); + } + } + + + } +} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj b/source - 복사본/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj new file mode 100644 index 0000000..22b1d26 --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj @@ -0,0 +1,350 @@ + + + + + Debug + AnyCPU + {EED2F3B9-8C20-4194-919E-8D151B29F70B} + Library + RJW_Menstruation + RJW_Menstruation + v4.7.2 + 512 + true + true + 게시\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + false + ..\..\..\Assemblies\ + DEBUG;TRACE + prompt + 4 + false + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + D:\잉어\Lib\Harmony.2.0.4.0\net472\0Harmony.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll + False + + + ..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.2\Assemblies\HugsLib.dll + False + + + ..\..\..\..\RJW\1.1\Assemblies\RJW.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\Unity.TextMeshPro.dll + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AccessibilityModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AndroidJNIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AnimationModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ARModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AssetBundleModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AudioModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClothModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterInputModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterRendererModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CrashReportingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DirectorModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DSPGraphModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.FileSystemHttpModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GameCenterModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GridModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.HotReloadModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ImageConversionModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputLegacyModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.JSONSerializeModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.LocalizationModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ParticleSystemModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PerformanceReportingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.Physics2DModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PhysicsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ProfilerModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ScreenCaptureModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SharedInternalsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteMaskModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteShapeModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.StreamingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SubstanceModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextCoreModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextRenderingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TilemapModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TLSModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UI.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIElementsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UmbraModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UNETModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityConnectModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VehiclesModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VFXModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VideoModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VRModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.WindModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.XRModule.dll + False + + + + + False + Microsoft .NET Framework 4.7.2%28x86 및 x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + \ No newline at end of file diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/RJW_Patch.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/RJW_Patch.cs new file mode 100644 index 0000000..894f3ae --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/RJW_Patch.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using HarmonyLib; +using rjw; +using Verse; + + +namespace RJW_Menstruation +{ + + [HarmonyPatch(typeof(PregnancyHelper), "impregnate")] + public static class impregnate_Patch + { + public static bool Prefix(Pawn pawn, Pawn partner, xxx.rjwSextype sextype = xxx.rjwSextype.None) + { + if (sextype == xxx.rjwSextype.Vaginal) + { + var pawnpartBPR = Genital_Helper.get_genitalsBPR(pawn); + var pawnparts = Genital_Helper.get_PartsHediffList(pawn, pawnpartBPR); + var partnerpartBPR = Genital_Helper.get_genitalsBPR(partner); + var partnerparts = Genital_Helper.get_PartsHediffList(partner, partnerpartBPR); + + if (Genital_Helper.has_vagina(partner, partnerparts)) + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner); + if (comp != null) + { + if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && PregnancyHelper.CanImpregnate(pawn, partner, sextype)) + { + PregnancyHelper.Doimpregnate(pawn, partner); + return false; + } + else comp.CumIn(pawn, Utility.GetCumVolume(pawn), 0); + } + } + else if (Genital_Helper.has_vagina(pawn, pawnparts)) + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn); + if (comp != null) + { + if (Genital_Helper.has_penis_fertile(partner, partnerparts) && PregnancyHelper.CanImpregnate(partner, pawn, sextype)) + { + PregnancyHelper.Doimpregnate(partner, pawn); + return false; + } + else comp.CumIn(partner, Utility.GetCumVolume(partner), 0); + } + } + } + return true; + + + } + } + + [HarmonyPatch(typeof(PregnancyHelper), "Doimpregnate")] + public static class Doimpregnate_Patch + { + public static bool Prefix(Pawn pawn, Pawn partner) // partner has vagina + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner); + if (comp != null) + { + if (AndroidsCompatibility.IsAndroid(pawn) && !AndroidsCompatibility.AndroidPenisFertility(pawn)) + { + comp.CumIn(pawn, Utility.GetCumVolume(pawn),0); + return false; + } + else comp.CumIn(pawn, Utility.GetCumVolume(pawn), pawn.health.capacities.GetLevel(xxx.reproduction)); + return false; + } + ModLog.Message("used original rjw method: Comp missing"); + return true; + } + } + + + + + + + + + +} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Translations.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Translations.cs new file mode 100644 index 0000000..6e524ba --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Translations.cs @@ -0,0 +1,60 @@ +using Verse; + +namespace RJW_Menstruation +{ + public static class Translations + { + public static readonly string Mod_Title = "Mod_Title".Translate(); + public static readonly string Info_noCum = "Info_noCum".Translate(); + public static readonly string Menstrual_Blood = "Menstrual_Blood".Translate(); + public static readonly string Stage_Follicular = "Stage_Follicular".Translate(); + public static readonly string Stage_Ovulatory = "Stage_Ovulatory".Translate(); + public static readonly string Stage_Luteal = "Stage_Luteal".Translate(); + public static readonly string Stage_Bleeding = "Stage_Bleeding".Translate(); + public static readonly string Stage_Fertilized = "Stage_Fertilized".Translate(); + public static readonly string Stage_Pregnant = "Stage_Pregnant".Translate(); + public static readonly string Stage_Recover = "Stage_Recover".Translate(); + + public static readonly string Dialog_WombInfo01 = "Dialog_WombInfo01".Translate(); + public static readonly string Dialog_WombInfo02 = "Dialog_WombInfo02".Translate(); + public static readonly string Dialog_WombInfo03 = "Dialog_WombInfo03".Translate(); + public static readonly string Dialog_WombInfo04 = "Dialog_WombInfo04".Translate(); + public static readonly string Dialog_WombInfo05 = "Dialog_WombInfo05".Translate(); + public static readonly string Dialog_WombInfo06 = "Dialog_WombInfo06".Translate(); + public static readonly string Dialog_WombInfo07 = "Dialog_WombInfo07".Translate(); + public static readonly string Dialog_WombInfo08 = "Dialog_WombInfo08".Translate(); + public static readonly string Dialog_WombInfo09 = "Dialog_WombInfo09".Translate(); + public static readonly string Dialog_WombInfo10 = "Dialog_WombInfo10".Translate(); + + + public static readonly string Option1_Label = "Option1_Label".Translate(); + public static readonly string Option1_Desc = "Option1_Desc".Translate(); + public static readonly string Option2_Label = "Option2_Label".Translate(); + public static readonly string Option2_Desc = "Option2_Desc".Translate(); + public static readonly string Option3_Label = "Option3_Label".Translate(); + public static readonly string Option3_Desc = "Option3_Desc".Translate(); + public static readonly string Option4_Label = "Option4_Label".Translate(); + public static readonly string Option4_Desc = "Option4_Desc".Translate(); + public static readonly string Option5_Label = "Option5_Label".Translate(); + public static readonly string Option5_Desc = "Option5_Desc".Translate(); + public static readonly string Option6_Label = "Option6_Label".Translate(); + public static readonly string Option6_Desc = "Option6_Desc".Translate(); + public static readonly string Option7_Label = "Option7_Label".Translate(); + public static readonly string Option7_Desc = "Option7_Desc".Translate(); + public static readonly string Option8_Label = "Option8_Label".Translate(); + public static readonly string Option8_Desc = "Option8_Desc".Translate(); + public static readonly string Option9_Label = "Option9_Label".Translate(); + public static readonly string Option9_Desc = "Option9_Desc".Translate(); + public static readonly string Option10_Label = "Option10_Label".Translate(); + public static readonly string Option10_Desc = "Option10_Desc".Translate(); + public static readonly string Option11_Label = "Option11_Label".Translate(); + public static readonly string Option11_Desc = "Option11_Desc".Translate(); + public static readonly string Option12_Label = "Option12_Label".Translate(); + public static readonly string Option12_Desc = "Option12_Desc".Translate(); + public static readonly string Option13_Label = "Option13_Label".Translate(); + public static readonly string Option13_Desc = "Option13_Desc".Translate(); + + + + } +} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Utility.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Utility.cs new file mode 100644 index 0000000..3723868 --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Utility.cs @@ -0,0 +1,223 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using rjw; +using RimWorld; +using UnityEngine; + +namespace RJW_Menstruation +{ + public static class Colors + { + public static Color blood = new Color(0.78f, 0, 0); + } + + + public static class Utility + { + + public static float GetCumVolume(Pawn pawn) + { + CompHediffBodyPart part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("penis")).InRandomOrder().FirstOrDefault().TryGetComp(); + if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorf")).InRandomOrder().FirstOrDefault().TryGetComp(); + if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorm")).InRandomOrder().FirstOrDefault().TryGetComp(); + if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("tentacle")).InRandomOrder().FirstOrDefault().TryGetComp(); + + return part?.FluidAmmount * part.FluidModifier * Rand.Range(0.8f, 1.2f) ?? 0.0f; + } + + public static HediffComp_Menstruation GetMenstruationComp(Pawn pawn) + { + var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + HediffComp_Menstruation result; + if (hedifflist.NullOrEmpty()) return null; + else + { + foreach (Hediff h in hedifflist) + { + result = h.TryGetComp(); + if (result != null) return result; + } + } + return null; + } + + public static bool HasMenstruationComp(Pawn pawn) + { + var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + HediffComp_Menstruation result; + if (hedifflist.NullOrEmpty()) return false; + else + { + foreach (Hediff h in hedifflist) + { + result = h.TryGetComp(); + if (result != null) return true; + } + } + return false; + } + + + public static HediffComp_Menstruation.Stage GetCurStage(Pawn pawn) + { + return GetMenstruationComp(pawn)?.curStage ?? HediffComp_Menstruation.Stage.Bleeding; + } + + + public static float GetPregnancyProgress(Pawn pawn) + { + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + return h.GestationProgress; + } + return -1; + } + + public static Pawn GetFetus(Pawn pawn) + { + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + return h?.babies?.First() ?? null; + } + //else if (hediff is Hediff_HumanlikePregnancy) + //{ + // Hediff_HumanlikePregnancy h = (Hediff_HumanlikePregnancy)hediff; + // return h?.babies?.First() ?? null; + //} + //else if (hediff is Hediff_BestialPregnancy) + //{ + // Hediff_BestialPregnancy h = (Hediff_BestialPregnancy)hediff; + // return h?.babies?.First() ?? null; + //} + else if (hediff is Hediff_MechanoidPregnancy) + { + Hediff_MechanoidPregnancy h = (Hediff_MechanoidPregnancy)hediff; + return h?.babies?.First() ?? null; + } + + + return null; + } + + + + public static Texture2D GetPregnancyIcon(HediffComp_Menstruation comp, Hediff hediff) + { + string icon = ""; + if (hediff is Hediff_MechanoidPregnancy) + { + return ContentFinder.Get(("Womb/Mechanoid_Fluid"), true); + } + else if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + string fetustex = DefDatabase.GetNamedSilentFail(h.babies.First().def.defName)?.fetusTexPath ?? "Fetus/Fetus_Default"; + if (h.GestationProgress < 0.2f) icon = comp.Props.wombTex + "_Implanted"; + else if (h.GestationProgress < 0.3f) icon += "Fetus/Fetus_Early00"; + else if (h.GestationProgress < 0.4f) icon += fetustex + "00"; + else if (h.GestationProgress < 0.5f) icon += fetustex + "01"; + else if (h.GestationProgress < 0.6f) icon += fetustex + "02"; + else if (h.GestationProgress < 0.7f) icon += fetustex + "03"; + else if (h.GestationProgress < 0.8f) icon += fetustex + "04"; + else icon += fetustex + "05"; + } + else icon = "Fetus/Slime_Abomi02"; + return ContentFinder.Get((icon), true); + } + + public static Texture2D GetCumIcon(HediffComp_Menstruation comp) + { + string icon = "Womb/"; + float cumpercent = comp.TotalCumPercent; + if (cumpercent < 0.001f) icon += "Empty"; + else if (cumpercent < 0.01f) icon += "Cum_00"; + else if (cumpercent < 0.05f) icon += "Cum_01"; + else if (cumpercent < 0.11f) icon += "Cum_02"; + else if (cumpercent < 0.17f) icon += "Cum_03"; + else if (cumpercent < 0.23f) icon += "Cum_04"; + else if (cumpercent < 0.29f) icon += "Cum_05"; + else if (cumpercent < 0.35f) icon += "Cum_06"; + else if (cumpercent < 0.41f) icon += "Cum_07"; + else if (cumpercent < 0.47f) icon += "Cum_08"; + else if (cumpercent < 0.53f) icon += "Cum_09"; + else if (cumpercent < 0.59f) icon += "Cum_10"; + else if (cumpercent < 0.65f) icon += "Cum_11"; + else if (cumpercent < 0.71f) icon += "Cum_12"; + else if (cumpercent < 0.77f) icon += "Cum_13"; + else if (cumpercent < 0.83f) icon += "Cum_14"; + else if (cumpercent < 0.89f) icon += "Cum_15"; + else if (cumpercent < 0.95f) icon += "Cum_16"; + else icon += "Cum_17"; + Texture2D cumtex = ContentFinder.Get((icon), true); + return cumtex; + } + + public static Texture2D GetWombIcon(HediffComp_Menstruation comp) + { + string icon = comp.Props.wombTex; + HediffComp_Menstruation.Stage stage = comp.curStage; + if (stage == HediffComp_Menstruation.Stage.Bleeding) icon += "_Bleeding"; + + Texture2D wombtex = ContentFinder.Get((icon), true); + + return wombtex; + } + + public static Texture2D GetGenitalIcon(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + string icon = "Genitals/"; + if (hediff.Severity < 0.20f) icon += "Vagina00"; //micro + else if (hediff.Severity < 0.30f) icon += "Vagina01"; //tight + else if (hediff.Severity < 0.40f) icon += "Vagina02"; //tight + else if (hediff.Severity < 0.47f) icon += "Vagina03"; //average + else if (hediff.Severity < 0.53f) icon += "Vagina04"; //average + else if (hediff.Severity < 0.60f) icon += "Vagina05"; //average + else if (hediff.Severity < 0.70f) icon += "Vagina06"; //accomodating + else if (hediff.Severity < 0.80f) icon += "Vagina07"; //accomodating + else if (hediff.Severity < 0.87f) icon += "Vagina08"; //cavernous + else if (hediff.Severity < 0.94f) icon += "Vagina09"; //cavernous + else if (hediff.Severity < 1.01f) icon += "Vagina10"; //cavernous + else icon += "Vagina11"; //abyssal + + return ContentFinder.Get((icon), true); + } + + public static Texture2D GetAnalIcon(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus")); + string icon = "Genitals/"; + if (hediff.Severity < 0.20f) icon += "Anal00"; //micro + else if (hediff.Severity < 0.40f) icon += "Anal01"; //tight + else if (hediff.Severity < 0.60f) icon += "Anal02"; //average + else if (hediff.Severity < 0.80f) icon += "Anal03"; //accomodating + else if (hediff.Severity < 1.01f) icon += "Anal04"; //cavernous + else icon += "Anal05"; //abyssal + + return ContentFinder.Get((icon), true); + } + + public static string GetVaginaLabel(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + return hediff.LabelBase + "\n" + hediff.LabelInBrackets; + } + public static string GetAnusLabel(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus")); + return hediff.Label; + } + + + + + } +} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs new file mode 100644 index 0000000..e84a4da --- /dev/null +++ b/source - 복사본/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using rjw; + +namespace RJW_Menstruation +{ + public static class VariousDefOf + { + public static readonly DNADef defaultDNA = new DNADef + { + fetusTexPath = "Fetus/Fetus_Default", + cumColor = new ColorInt(255, 255, 255, 255), + cumTickness = 0 + }; + + public static readonly ThingDef CumFilth = DefDatabase.GetNamed("FilthCum"); + public static readonly HediffDef RJW_IUD = DefDatabase.GetNamed("RJW_IUD"); + + } +} diff --git a/source/RJW Menstruation/RJW_Menstruation/App.config b/source/RJW Menstruation/RJW_Menstruation/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/source/RJW Menstruation/RJW_Menstruation/Configurations.cs b/source/RJW Menstruation/RJW_Menstruation/Configurations.cs new file mode 100644 index 0000000..c765e78 --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/Configurations.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; + +namespace RJW_Menstruation +{ + public class Configurations : ModSettings + { + public static readonly float ImplantationChanceDefault = 0.25f; + public static readonly int ImplantationChanceAdjustDefault = 25; + public static readonly float FertilizeChanceDefault = 0.05f; + public static readonly int FertilizeChanceAdjustDefault = 50; + public static readonly float CumDecayRatioDefault = 0.05f; + public static readonly int CumDecayRatioAdjustDefault = 50; + public static readonly float CumFertilityDecayRatioDefault = 0.2f; + public static readonly int CumFertilityDecayRatioAdjustDefault = 200; + public static readonly int CycleAccelerationDefault = 6; + + public static float ImplantationChance = ImplantationChanceDefault; + public static int ImplantationChanceAdjust = ImplantationChanceAdjustDefault; + public static float FertilizeChance = FertilizeChanceDefault; + public static int FertilizeChanceAdjust = FertilizeChanceAdjustDefault; + public static float CumDecayRatio = CumDecayRatioDefault; + public static int CumDecayRatioAdjust = CumDecayRatioAdjustDefault; + public static float CumFertilityDecayRatio = CumFertilityDecayRatioDefault; + public static int CumFertilityDecayRatioAdjust = CumFertilityDecayRatioAdjustDefault; + public static int CycleAcceleration = CycleAccelerationDefault; + public static bool EnableWombIcon = true; + public static bool EnableAnimalCycle = false; + public static bool Debug = false; + + public override void ExposeData() + { + Scribe_Values.Look(ref ImplantationChanceAdjust, "ImplantationChanceAdjust", ImplantationChanceAdjust, true); + Scribe_Values.Look(ref ImplantationChance, "ImplantationChance", ImplantationChance, true); + Scribe_Values.Look(ref FertilizeChanceAdjust, "FertilizeChanceAdjust", FertilizeChanceAdjust, true); + Scribe_Values.Look(ref FertilizeChance, "FertilizeChance", FertilizeChance, true); + Scribe_Values.Look(ref CumDecayRatioAdjust, "CumDecayRatioAdjust", CumDecayRatioAdjust, true); + Scribe_Values.Look(ref CumDecayRatio, "CumDecayRatio", CumDecayRatio, true); + Scribe_Values.Look(ref CumFertilityDecayRatioAdjust, "CumFertilityDecayRatioAdjust", CumFertilityDecayRatioAdjust, true); + Scribe_Values.Look(ref CumFertilityDecayRatio, "CumFertilityDecayRatio", CumFertilityDecayRatio, true); + Scribe_Values.Look(ref EnableWombIcon, "EnableWombIcon", EnableWombIcon, true); + Scribe_Values.Look(ref EnableAnimalCycle, "EnableAnimalCycle", EnableAnimalCycle, true); + base.ExposeData(); + } + + + } + + + public class RJW_Menstruation : Mod + { + + private readonly Configurations config; + public RJW_Menstruation(ModContentPack content) : base(content) + { + config = GetSettings(); + + } + + public override string SettingsCategory() + { + return Translations.Mod_Title; + } + + public override void DoSettingsWindowContents(Rect inRect) + { + Rect mainRect = inRect.ContractedBy(20f); + Listing_Standard listmain = new Listing_Standard(); + listmain.Begin(mainRect); + + listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc); + + listmain.CheckboxLabeled(Translations.Option2_Label, ref Configurations.EnableAnimalCycle, Translations.Option2_Desc); + + listmain.Label(Translations.Option3_Label + " " + Configurations.ImplantationChance*100 + "%", -1, Translations.Option3_Desc); + Configurations.ImplantationChanceAdjust = (int)listmain.Slider(Configurations.ImplantationChanceAdjust, 0, 1000); + Configurations.ImplantationChance = (float)Configurations.ImplantationChanceAdjust/100; + + listmain.Label(Translations.Option4_Label + " " + Configurations.FertilizeChance*100 + "%", -1, Translations.Option4_Desc); + Configurations.FertilizeChanceAdjust = (int)listmain.Slider(Configurations.FertilizeChanceAdjust, 0, 1000); + Configurations.FertilizeChance = (float)Configurations.FertilizeChanceAdjust/1000; + + listmain.Label(Translations.Option5_Label + " " + Configurations.CumDecayRatio*100 + "%", -1, Translations.Option5_Desc); + Configurations.CumDecayRatioAdjust = (int)listmain.Slider(Configurations.CumDecayRatioAdjust, 0, 1000); + Configurations.CumDecayRatio = (float)Configurations.CumDecayRatioAdjust/1000; + + listmain.Label(Translations.Option6_Label + " " + Configurations.CumFertilityDecayRatio*100 + "%", -1, Translations.Option6_Desc); + Configurations.CumFertilityDecayRatioAdjust = (int)listmain.Slider(Configurations.CumFertilityDecayRatioAdjust, 0, 1000); + Configurations.CumFertilityDecayRatio = (float)Configurations.CumFertilityDecayRatioAdjust/1000; + + listmain.Label(Translations.Option7_Label + " x" + Configurations.CycleAcceleration, -1, Translations.Option7_Desc); + Configurations.CycleAcceleration = (int)listmain.Slider(Configurations.CycleAcceleration,1,50); + + + listmain.CheckboxLabeled(Translations.Option8_Label, ref Configurations.Debug, Translations.Option8_Desc); + if (listmain.ButtonText("reset to default")) + { + Configurations.ImplantationChanceAdjust = Configurations.ImplantationChanceAdjustDefault; + Configurations.FertilizeChanceAdjust = Configurations.FertilizeChanceAdjustDefault; + Configurations.CumDecayRatioAdjust = Configurations.CumDecayRatioAdjustDefault; + Configurations.CumFertilityDecayRatioAdjust = Configurations.CumFertilityDecayRatioAdjustDefault; + Configurations.EnableWombIcon = true; + Configurations.EnableAnimalCycle = false; + Configurations.CycleAcceleration = Configurations.CycleAccelerationDefault; + } + + + listmain.End(); + + + } + + + } + + + + +} diff --git a/source/RJW Menstruation/RJW_Menstruation/Cum.cs b/source/RJW Menstruation/RJW_Menstruation/Cum.cs new file mode 100644 index 0000000..3fbb33f --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/Cum.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using UnityEngine; +using rjw; + +namespace RJW_Menstruation +{ + public class Cum : IExposable + { + public Pawn pawn; + + //public bool failedFertilization = false; + //public bool dead = false; + public float volume; // ml + public float fertvolume; + public float fertFactor = 1.0f; + public bool notcum = false; // for other fluids + public string notcumLabel = ""; + private bool useCustomColor = false; + private float notcumthickness = 0; + public float decayresist + { + get + { + if (!notcum) return DNA.cumTickness; + else return notcumthickness; + } + set + { + notcumthickness = value; + } + } + private Color customColor; + public DNADef DNA + { + get + { + if (DNAcache == null) + { + DNAcache = DefDatabase.GetNamedSilentFail(pawn.def.defName); + if (DNAcache == null) + { + DNAcache = VariousDefOf.defaultDNA; + } + return DNAcache; + } + else return DNAcache; + } + } + private DNADef DNAcache = null; + public ThingDef FilthDef + { + get + { + if (filthDef == null) return VariousDefOf.CumFilth; + else return filthDef; + } + set + { + filthDef = value; + } + } + private ThingDef filthDef = null; + public Color color + { + get + { + if (!useCustomColor) return DNA.CumColor; + else return customColor; + } + + set + { + useCustomColor = true; + customColor = value; + } + } + + + public Cum() {} + + public Cum(Pawn pawn) + { + this.pawn = pawn; + volume = 1.0f; + fertvolume = 1.0f; + decayresist = 0; + } + + public Cum(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthDef = null) + { + this.pawn = pawn; + this.volume = volume; + this.fertvolume = volume; + this.notcum = true; + this.notcumLabel = notcumlabel; + this.notcumthickness = decayresist; + this.filthDef = filthDef; + } + + public Cum(Pawn pawn, float volume, float fertility, ThingDef filthDef = null) + { + this.pawn = pawn; + this.volume = volume; + if (fertility > 0) + { + this.fertvolume = volume; + this.fertFactor = fertility; + } + else this.fertvolume = 0; + this.filthDef = filthDef; + } + + + + public void ExposeData() + { + Scribe_References.Look(ref pawn, "pawn", true); + Scribe_Values.Look(ref volume, "volume", volume, true); + Scribe_Values.Look(ref fertvolume, "fertvolume", fertvolume, true); + Scribe_Values.Look(ref notcumthickness, "notcumthickness", notcumthickness, true); + Scribe_Values.Look(ref fertFactor, "fertFactor", fertFactor, true); + Scribe_Values.Look(ref notcum, "notcum", notcum, true); + Scribe_Values.Look(ref notcumLabel, "notcumLabel", notcumLabel, true); + Scribe_Values.Look(ref useCustomColor, "useCustomColor", useCustomColor, true); + Scribe_Values.Look(ref customColor, "customColor", customColor, true); + + } + } + + + + + + +} diff --git a/source/RJW Menstruation/RJW_Menstruation/DNADef.cs b/source/RJW Menstruation/RJW_Menstruation/DNADef.cs new file mode 100644 index 0000000..5f19368 --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/DNADef.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using UnityEngine; + + +namespace RJW_Menstruation +{ + public class DNADef : Def + { + public bool IsNone => string.IsNullOrEmpty(defName); + public static readonly DNADef None = new DNADef(); + + public string fetusTexPath; + public ColorInt cumColor; + public Color CumColor => cumColor.ToColor; + public float cumTickness = 0f; + + } + + + +} diff --git a/source/RJW Menstruation/RJW_Menstruation/Dialog_WombStatus.cs b/source/RJW Menstruation/RJW_Menstruation/Dialog_WombStatus.cs new file mode 100644 index 0000000..6ed4294 --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/Dialog_WombStatus.cs @@ -0,0 +1,204 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; +using RimWorld; +using rjw; + +namespace RJW_Menstruation +{ + public class Dialog_WombStatus : Window + { + private Pawn pawn; + private HediffComp_Menstruation comp; + private const float windowMargin = 20f; + private const float pawnRectWidth = 150f; + private const float pawnRectHeight = 150f; + private const float wombRectHeight = 270f; + private const float wombRectWidth = 300f; + private const float fontheight = 30; + private const float genitalRectWidth = 102; + private const float genitalRectHeight = 140; + + + private Texture2D womb; + private Texture2D cum; + private Texture2D vagina; + private Texture2D anal; + private Color cumcolor; + + public override Vector2 InitialSize + { + get + { + return new Vector2(300f + 2*windowMargin,800f); + } + } + + public Dialog_WombStatus(Pawn pawn, HediffComp_Menstruation comp, Texture2D icon) + { + this.pawn = pawn; + this.comp = comp; + womb = icon; + } + + public override void DoWindowContents(Rect inRect) + { + bool flag = false; + soundClose = SoundDefOf.InfoCard_Close; + //closeOnClickedOutside = true; + absorbInputAroundWindow = false; + forcePause = false; + preventCameraMotion = false; + draggable = true; + //resizeable = true; + + if (Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.Escape)) + { + flag = true; + Event.current.Use(); + } + + Rect windowRect = inRect.ContractedBy(windowMargin); + Rect mainRect = new Rect(windowRect.x, windowRect.y, windowRect.width, windowRect.height - 20f); + Rect closeRect = new Rect(windowRect.xMax, 0f, 20f, 20f); + MainContents(mainRect); + if (Widgets.CloseButtonFor(closeRect)) + { + Close(); + } + } + + private void MainContents(Rect mainRect) + { + GUIStyle fontstylecenter = new GUIStyle() { alignment = TextAnchor.MiddleCenter }; + GUIStyle fontstyleright = new GUIStyle() { alignment = TextAnchor.MiddleRight }; + GUIStyle fontstyleleft = new GUIStyle() { alignment = TextAnchor.MiddleLeft }; + GUIStyle boxstyle = new GUIStyle(GUI.skin.textArea); + GUIStyle buttonstyle = new GUIStyle(GUI.skin.button); + boxstyle.hover = boxstyle.normal; + boxstyle.onHover = boxstyle.normal; + boxstyle.onNormal = boxstyle.normal; + + buttonstyle.onHover = buttonstyle.onNormal; + buttonstyle.hover = buttonstyle.normal; + boxstyle.border.left = 4; boxstyle.border.right = 4; boxstyle.border.bottom = 4; boxstyle.border.top = 4; + + float preginfoheight = 0f; + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + if (pawn.IsPregnant()) + { + womb = Utility.GetPregnancyIcon(comp, hediff); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + if (h.GestationProgress < 0.2f) cum = Utility.GetCumIcon(comp); + else cum = ContentFinder.Get(("Womb/Empty"), true); + Pawn fetus = Utility.GetFetus(pawn); + preginfoheight = fontheight; + Rect preginfo = new Rect(0f, mainRect.yMax - wombRectHeight - 2, wombRectWidth, preginfoheight); + if (fetus != null) + { + fontstyleright.normal.textColor = Color.white; + buttonstyle.alignment = TextAnchor.MiddleLeft; + GUI.Box(preginfo, h.babies.Count + " " + fetus.def.label + " " + Translations.Dialog_WombInfo02, buttonstyle); + GUI.Label(preginfo, Translations.Dialog_WombInfo03 + ": " + h.father.LabelShort + " ", fontstyleright); + } + + } + else cum = ContentFinder.Get(("Womb/Empty"), true); + } + else + { + womb = Utility.GetWombIcon(comp); + cum = Utility.GetCumIcon(comp); + } + + + Rect pawnRect = new Rect(0, 0, pawnRectWidth, pawnRectHeight); + Widgets.DrawTextureFitted(pawnRect,PortraitsCache.Get(pawn, pawnRect.size),1.0f); + Rect pawnLabelRect = new Rect(0, pawnRectHeight, pawnRectWidth, fontheight-10); + Rect pawnLabel2Rect = new Rect(0, pawnRectHeight+fontheight-10, pawnRectWidth, fontheight-10); + fontstylecenter.normal.textColor = pawn.DrawColor; + GUI.Label(pawnLabelRect, pawn.Name.ToStringFull, fontstylecenter); + GUI.Label(pawnLabel2Rect, pawn.story.Title, fontstylecenter); + GUI.color = Color.white; + + + Rect wombInfoRect = new Rect(0f, mainRect.yMax - wombRectHeight - fontheight - 2, wombRectWidth, fontheight); + + buttonstyle.normal.textColor = Color.white; + //boxstyle.normal.background = Texture2D.whiteTexture; + buttonstyle.alignment = TextAnchor.MiddleLeft; + GUI.backgroundColor = new Color(0.24f, 0.29f, 0.35f, 1); + GUI.Box(wombInfoRect, Translations.Dialog_WombInfo01 + ": " + comp.GetCurStageLabel,buttonstyle); + GUI.color = Color.white; + + + fontstyleright.normal.textColor = Color.red; + if (comp.GetFertilization) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo05 + " ", fontstyleright); + else if (comp.GetEggFertilizing) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo06 + " ", fontstyleright); + else if (comp.GetEgg) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo07 + " ", fontstyleright); + + //Widgets.Label(wombInfoRect,Translations.Dialog_WombInfo01 + ": " + comp.GetCurStageLabel); + + + cumcolor = comp.GetCumMixtureColor; + Rect wombRect = new Rect(0f, mainRect.yMax - wombRectHeight + preginfoheight, wombRectWidth, wombRectHeight); + GUI.color = new Color(1.00f,0.47f,0.47f,1); + GUI.Box(wombRect,"",boxstyle); + //GUI.color = Color.white; + //Widgets.DrawTextureFitted(wombRect, womb,1.0f); + //GUI.color = cumcolor; + //Widgets.DrawTextureFitted(wombRect, cum,1.0f); + GUI.DrawTexture(wombRect, womb, ScaleMode.ScaleToFit, true, 0, Color.white, 0, 0); + GUI.DrawTexture(wombRect, cum, ScaleMode.ScaleToFit, true, 0, cumcolor,0,0); + GUI.color = Color.white; + + Rect cumlistTitle = new Rect(pawnRectWidth, 0, wombRectWidth - pawnRectWidth, fontheight); + GUI.Label(cumlistTitle,Translations.Dialog_WombInfo04); + + Rect cumlistRect = new Rect(pawnRectWidth, fontheight, wombRectWidth - pawnRectWidth, mainRect.yMax - wombRectHeight - fontheight); + Listing_Standard cumlist = new Listing_Standard + { + maxOneColumn = true, + ColumnWidth = wombRectWidth - pawnRectWidth + }; + cumlist.Begin(cumlistRect); + Listing_Standard cumlistsection = cumlist.BeginSection_NewTemp(mainRect.yMax - wombRectHeight - 2 * fontheight - 12f); + foreach(string s in comp.GetCumsInfo) + { + cumlistsection.Label(s); + } + cumlist.EndSection(cumlistsection); + cumlist.End(); + + Rect genitalRect = new Rect(24, pawnRectHeight + 2*fontheight, genitalRectWidth, genitalRectHeight + fontheight*2); + Rect genitalIconRect = new Rect(genitalRect.x,genitalRect.y + fontheight ,genitalRectWidth,genitalRectHeight); + Rect genitalVaginaLabelRect = new Rect(genitalRect.x,genitalRect.y,genitalRectWidth,fontheight); + Rect genitalAnusLabelRect = new Rect(genitalRect.x,genitalRect.y + fontheight +genitalRectHeight ,genitalRectWidth,fontheight); + + vagina = Utility.GetGenitalIcon(pawn); + anal = Utility.GetAnalIcon(pawn); + GUI.color = new Color(1.00f, 0.47f, 0.47f, 1); + GUI.Box(genitalRect, "", boxstyle); + GUI.color = pawn.story.SkinColor; + //Widgets.DrawTextureFitted(genitalIconRect, anal, 1.0f); + //Widgets.DrawTextureFitted(genitalIconRect, vagina, 1.0f); + GUI.DrawTexture(genitalIconRect, anal, ScaleMode.ScaleToFit); + GUI.DrawTexture(genitalIconRect, vagina, ScaleMode.ScaleToFit); + + GUI.color = Color.white; + GUI.Label(genitalVaginaLabelRect, Utility.GetVaginaLabel(pawn),fontstylecenter); + GUI.Label(genitalAnusLabelRect, Utility.GetAnusLabel(pawn),fontstylecenter); + + } + + + + + } +} diff --git a/source/RJW Menstruation/RJW_Menstruation/DrugOutcomDoers.cs b/source/RJW Menstruation/RJW_Menstruation/DrugOutcomDoers.cs new file mode 100644 index 0000000..5f5e314 --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/DrugOutcomDoers.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RimWorld; +using Verse; + +namespace RJW_Menstruation +{ + public class FertPillOutcomDoer : IngestionOutcomeDoer + { + protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested) + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn); + if (comp.curStage.Equals(HediffComp_Menstruation.Stage.Follicular) || comp.curStage.Equals(HediffComp_Menstruation.Stage.Luteal)) comp.curStage = HediffComp_Menstruation.Stage.Ovulatory; + } + } + + +} diff --git a/source/RJW Menstruation/RJW_Menstruation/GetGizmos.cs b/source/RJW Menstruation/RJW_Menstruation/GetGizmos.cs new file mode 100644 index 0000000..cc884c7 --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/GetGizmos.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using HarmonyLib; +using Verse; +using RimWorld; +using rjw; +using UnityEngine; +using Verse.Sound; + +namespace RJW_Menstruation +{ + [HarmonyPatch(typeof(Pawn), "GetGizmos")] + public class Pawn_GetGizmos + { + public static void Postfix(ref IEnumerable __result, Pawn __instance) + { + List gizmoList = __result.ToList(); + bool isCreatureMine = __instance.Faction != null && (__instance.Faction.IsPlayer || __instance.IsPrisonerOfColony); + + if (!isCreatureMine) + { + return; + } + + if (Configurations.EnableWombIcon && __instance.gender == Gender.Female) + { + if (!__instance.IsAnimal()) + { + AddWombGizmos(__instance, ref gizmoList); + } + else if (Configurations.EnableAnimalCycle) + { + AddWombGizmos(__instance, ref gizmoList); + } + + } + + + + + __result = gizmoList; + } + + + private static void AddWombGizmos(Pawn __instance, ref List gizmoList) + { + gizmoList.Add(CreateGizmo_WombStatus(__instance)); + } + + private static Gizmo CreateGizmo_WombStatus(Pawn pawn) + { + HediffComp_Menstruation comp = pawn.health.hediffSet.GetFirstHediffOfDef(Genital_Helper.average_vagina).TryGetComp(); + Texture2D icon,icon_overay; + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + string description = ""; + if (Configurations.Debug) description += comp.curStage + ": " + comp.curStageHrs + "\n" + "fertcums: " + comp.TotalFertCum; + else description += comp.GetCurStageLabel + "\n"; + if (pawn.IsPregnant()) + { + icon = Utility.GetPregnancyIcon(comp,hediff); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + if (h.GestationProgress < 0.2f) icon_overay = Utility.GetCumIcon(comp); + else icon_overay = ContentFinder.Get(("Womb/Empty"), true); + } + else icon_overay = ContentFinder.Get(("Womb/Empty"), true); + } + else + { + icon = Utility.GetWombIcon(comp); + icon_overay = Utility.GetCumIcon(comp); + } + foreach (string s in comp.GetCumsInfo) description += s + "\n"; + + Color c = comp.GetCumMixtureColor; + + Gizmo gizmo = new Gizmo_Womb + { + defaultLabel = pawn.LabelShort, + defaultDesc = description, + icon = icon, + icon_overay = icon_overay, + cumcolor = c, + order = 100, + action = delegate + { + SoundDefOf.InfoCard_Open.PlayOneShotOnCamera(); + Find.WindowStack.Add(new Dialog_WombStatus(pawn, comp,icon)); + } + }; + return gizmo; + } + } + + + + + + +} diff --git a/source/RJW Menstruation/RJW_Menstruation/Gizmo_Womb.cs b/source/RJW Menstruation/RJW_Menstruation/Gizmo_Womb.cs new file mode 100644 index 0000000..e91f20f --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/Gizmo_Womb.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using UnityEngine; +using Verse.Sound; + +namespace RJW_Menstruation +{ + public class Gizmo_Womb : Command_Action + { + public Texture2D icon_overay; + public Color cumcolor; + + protected override void DrawIcon(Rect rect, Material buttonMat = null) + { + Texture2D badTex = icon; + Texture2D overay = icon_overay; + Color color = cumcolor; + + if (badTex == null) + { + badTex = BaseContent.BadTex; + } + if (overay == null) + { + overay = BaseContent.BadTex; + } + if (color == null) color = Color.white; + rect.position += new Vector2(iconOffset.x * rect.size.x, iconOffset.y * rect.size.y); + GUI.color = IconDrawColor; + Widgets.DrawTextureFitted(rect, badTex, this.iconDrawScale * 0.85f, this.iconProportions, this.iconTexCoords, this.iconAngle, buttonMat); + GUI.color = color; + Widgets.DrawTextureFitted(rect, overay, iconDrawScale * 0.85f, iconProportions, iconTexCoords, iconAngle, buttonMat); + GUI.color = Color.white; + } + + + + + } +} diff --git a/source/RJW Menstruation/RJW_Menstruation/Harmony.cs b/source/RJW Menstruation/RJW_Menstruation/Harmony.cs new file mode 100644 index 0000000..6e3171c --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/Harmony.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Reflection; +using HarmonyLib; +using Verse; +using RimWorld; +using rjw; + +namespace RJW_Menstruation +{ + [StaticConstructorOnStartup] + internal static class First + { + static First() + { + var har = new Harmony("LL"); + har.PatchAll(Assembly.GetExecutingAssembly()); + } + } + + + + +} diff --git a/source/RJW Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs b/source/RJW Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs new file mode 100644 index 0000000..4737ac4 --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs @@ -0,0 +1,780 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using HugsLib; +using rjw; +using UnityEngine; + +namespace RJW_Menstruation +{ + public class CompProperties_Menstruation : HediffCompProperties + { + public float maxCumCapacity; // ml + public float baseImplantationChanceFactor; + public float basefertilizationChanceFactor; + public float deviationFactor; + public int folicularIntervalDays = 14; //before ovulation including beginning of bleeding + public int lutealIntervalDays = 14; //after ovulation until bleeding + public int bleedingIntervalDays = 6; //must be less than folicularIntervalDays + public int recoveryIntervalDays = 10; //additional infertile days after gave birth + public int eggLifespanDays = 2; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday + public string wombTex = "Womb/Womb"; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday + + + public CompProperties_Menstruation() + { + + compClass = typeof(HediffComp_Menstruation); + } + } + + + public class HediffComp_Menstruation : HediffComp + { + const float minmakefilthvalue = 1.0f; + + public static readonly int tickInterval = 2500; // an hour + public CompProperties_Menstruation Props; + public Stage curStage = Stage.Follicular; + public int curStageHrs = 0; + + public enum Stage + { + Follicular, + Ovulatory, + Luteal, + Bleeding, + Fertilized, + Pregnant, + Recover + } + + private List cums; + private bool loaded = false; + private List eggs; + private int follicularIntervalhours = -1; + private int lutealIntervalhours = -1; + private int bleedingIntervalhours = -1; + private int recoveryIntervalhours = -1; + private Action actionref; + + public float TotalCum + { + get + { + float res = 0; + if (cums.NullOrEmpty()) return 0; + foreach (Cum cum in cums) + { + res += cum.volume; + } + return res; + } + } + public float TotalFertCum + { + get + { + float res = 0; + if (cums.NullOrEmpty()) return 0; + foreach (Cum cum in cums) + { + if (!cum.notcum) res += cum.fertvolume; + } + return res; + } + } + public float TotalCumPercent + { + get + { + float res = 0; + if (cums.NullOrEmpty()) return 0; + foreach (Cum cum in cums) + { + res += cum.volume; + } + return res/ Props.maxCumCapacity; + } + } + public float CumCapacity + { + get + { + float res = Props.maxCumCapacity; + if (curStage == Stage.Pregnant) res *= 0.2f; + return res; + } + } + public float CumInFactor + { + get + { + float res = 1.0f; + if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) res = 0.001f; + return res; + } + } + //make follicular interval into half and double egg lifespan + public float CycleFactor + { + get + { + if (xxx.has_quirk(parent.pawn, "Breeder")) return 0.5f; + + return 1.0f; + } + } + //effect on implant chance + public float ImplantFactor + { + get + { + float factor = 1.0f; + if (xxx.has_quirk(parent.pawn, "Breeder")) factor = 10.0f; + if (xxx.is_animal(parent.pawn)) factor *= RJWPregnancySettings.animal_impregnation_chance/100f; + else factor *= RJWPregnancySettings.humanlike_impregnation_chance/100f; + return parent.pawn.health.capacities.GetLevel(xxx.reproduction) * factor; + } + } + public IEnumerable GetCumsInfo + { + get + { + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (!cum.notcum) yield return String.Format(cum.pawn.Label + ": {0:0.##}ml", cum.volume); + else yield return String.Format(cum.notcumLabel + ": {0:0.##}ml", cum.volume); + } + else yield return Translations.Info_noCum; + } + } + public Color GetCumMixtureColor + { + get + { + Color mixedcolor = Color.white; + + if (!cums.NullOrEmpty()) + { + float mixedsofar = 0; + foreach (Cum cum in cums) + { + mixedcolor = Color.LerpUnclamped(mixedcolor, cum.color, cum.volume/(mixedsofar + cum.volume)); + mixedsofar += cum.volume; + } + } + return mixedcolor; + } + } + public string GetCurStageLabel + { + get + { + switch (curStage) + { + case Stage.Follicular: + return Translations.Stage_Follicular; + case Stage.Ovulatory: + return Translations.Stage_Ovulatory; + case Stage.Luteal: + return Translations.Stage_Luteal; + case Stage.Bleeding: + return Translations.Stage_Bleeding; + case Stage.Fertilized: + return Translations.Stage_Fertilized; + case Stage.Pregnant: + return Translations.Stage_Pregnant; + case Stage.Recover: + return Translations.Stage_Recover; + default: + return ""; + } + } + + } + public bool GetEggFertilizing + { + get + { + if (!eggs.NullOrEmpty()) + { + if (!cums.NullOrEmpty()) foreach(Cum cum in cums) + { + if (cum.fertvolume > 0) return true; + } + return false; + + } + else return false; + } + } + public bool GetFertilization + { + get + { + if (!eggs.NullOrEmpty()) foreach(Egg egg in eggs) + { + if (egg.fertilized) return true; + } + return false; + } + } + public bool GetEgg + { + get + { + return !eggs.NullOrEmpty(); + } + } + + + public override void CompExposeData() + { + base.CompExposeData(); + Scribe_Collections.Look(ref cums, saveDestroyedThings: true, label: "cums", lookMode: LookMode.Deep, ctorArgs: new object[0]); + Scribe_Collections.Look(ref eggs, saveDestroyedThings: true, label: "eggs", lookMode: LookMode.Deep, ctorArgs: new object[0]); + Scribe_Values.Look(ref curStage, "curStage", curStage, true); + Scribe_Values.Look(ref curStageHrs, "curStageHrs", curStageHrs, true); + Scribe_Values.Look(ref follicularIntervalhours, "follicularIntervalhours", follicularIntervalhours, true); + Scribe_Values.Look(ref lutealIntervalhours, "lutealIntervalhours", lutealIntervalhours, true); + Scribe_Values.Look(ref bleedingIntervalhours, "bleedingIntervalhours", bleedingIntervalhours, true); + Scribe_Values.Look(ref recoveryIntervalhours, "recoveryIntervalhours", recoveryIntervalhours, true); + + + } + + public override void CompPostTick(ref float severityAdjustment) + { + if (!loaded) + { + Props = (CompProperties_Menstruation)props; + if (follicularIntervalhours < 0) + { + follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24,Props.deviationFactor); + curStage = RandomStage(); + } + + if (lutealIntervalhours < 0) lutealIntervalhours = PeriodRandomizer(Props.lutealIntervalDays*24, Props.deviationFactor); + if (bleedingIntervalhours < 0) bleedingIntervalhours = PeriodRandomizer(Props.bleedingIntervalDays*24, Props.deviationFactor); + if (recoveryIntervalhours < 0) recoveryIntervalhours = PeriodRandomizer(Props.recoveryIntervalDays * 24, Props.deviationFactor); + if (cums == null) cums = new List(); + if (eggs == null) eggs = new List(); + if (parent.pawn.IsPregnant()) curStage = Stage.Pregnant; + if (Configurations.EnableAnimalCycle) + { + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false); + } + else if (!parent.pawn.IsAnimal()) HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false); + loaded = true; + } + } + + public override void CompPostPostRemoved() + { + HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(actionref); + ModLog.Message(parent.pawn.Label + "tick scheduler removed"); + base.CompPostPostRemoved(); + } + + + public Cum GetNotCum(string notcumlabel) + { + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.notcum && cum.notcumLabel.Equals(notcumlabel)) return cum; + } + return null; + } + + public Cum GetCum(Pawn pawn) + { + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (!cum.notcum && cum.pawn.Equals(pawn)) return cum; + } + return null; + } + + + + public void CumIn(Pawn pawn, float injectedvolume, float fertility = 1.0f, ThingDef filthdef = null) + { + float volume = injectedvolume * CumInFactor; + float tmp = TotalCum + volume; + if (tmp > Props.maxCumCapacity) + { + float cumoutrate = 1 - (Props.maxCumCapacity / tmp); + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.pawn.Equals(pawn)) + { + cum.volume += volume; + cum.fertvolume += volume; + cum.FilthDef = filthdef; + merged = true; + } + cum.volume *= 1 - cumoutrate; + cum.fertvolume *= 1 - cumoutrate; + } + if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate),fertility, filthdef)); + } + else + { + + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.pawn.Equals(pawn)) + { + cum.volume += volume; + cum.fertvolume += volume; + cum.FilthDef = filthdef; + merged = true; + } + } + if (!merged) cums.Add(new Cum(pawn, volume, fertility, filthdef)); + } + } + + public void CumIn(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthdef = null) + { + float tmp = TotalCum + volume; + if (tmp > Props.maxCumCapacity) + { + float cumoutrate = 1 - (Props.maxCumCapacity / tmp); + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.notcum && cum.pawn.Equals(pawn) && cum.notcumLabel.Equals(notcumlabel)) + { + cum.volume += volume; + cum.decayresist = decayresist; + cum.fertvolume = 0; + cum.FilthDef = filthdef; + merged = true; + } + cum.volume *= 1 - cumoutrate; + cum.fertvolume *= 1 - cumoutrate; + } + if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate), notcumlabel,decayresist, filthdef)); + } + else + { + + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.notcum && cum.pawn.Equals(pawn) && cum.notcumLabel.Equals(notcumlabel)) + { + cum.volume += volume; + cum.decayresist = decayresist; + cum.fertvolume = 0; + cum.FilthDef = filthdef; + merged = true; + } + } + if (!merged) cums.Add(new Cum(pawn, volume, notcumlabel,decayresist, filthdef)); + } + } + + + public void CumOut() + { + if (cums.NullOrEmpty()) return; + List removecums = new List(); + foreach(Cum cum in cums) + { + float vd = cum.volume; + cum.volume *= Math.Max(0,(1 - (Configurations.CumDecayRatio * (1 - cum.decayresist)))); + cum.fertvolume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist))) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist)))); + if (vd - cum.volume > minmakefilthvalue) MakeCumFilth(cum); + if (cum.fertvolume < 0.01f) cum.fertvolume = 0; + if (cum.volume < 0.01f) removecums.Add(cum); + } + foreach(Cum cum in removecums) + { + cums.Remove(cum); + } + removecums.Clear(); + } + + public float CumOut(Cum targetcum, float portion = 0.1f) + { + if (cums.NullOrEmpty()) return 0; + float outcum = 0; + List removecums = new List(); + foreach (Cum cum in cums) + { + float vd = cum.volume; + if (cum.Equals(targetcum)) outcum = cum.volume * (portion * (1 - cum.decayresist)); + cum.volume *= Math.Max(0, 1 - (portion * (1 - cum.decayresist))); + cum.fertvolume *= Math.Max(0, (1 - (portion * (1 - cum.decayresist))) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist)))); + if (vd-cum.volume > minmakefilthvalue) MakeCumFilth(cum); + if (cum.fertvolume < 0.01f) cum.fertvolume = 0; + if (cum.volume < 0.01f) removecums.Add(cum); + } + foreach (Cum cum in removecums) + { + cums.Remove(cum); + } + removecums.Clear(); + return outcum; + } + + //ignores cum.decayresist + public float CumOutForce(Cum targetcum, float portion = 0.1f) + { + if (cums.NullOrEmpty()) return 0; + float outcum = 0; + List removecums = new List(); + foreach (Cum cum in cums) + { + float vd = cum.volume; + if (cum.Equals(targetcum)) outcum = cum.volume * (portion); + cum.volume *= 1 - (portion); + cum.fertvolume *= (1 - (portion)) * (1 - (Configurations.CumFertilityDecayRatio)); + if (vd - cum.volume > minmakefilthvalue) MakeCumFilth(cum); + if (cum.fertvolume < 0.01f) cum.fertvolume = 0; + if (cum.volume < 0.1f) removecums.Add(cum); + } + foreach (Cum cum in removecums) + { + cums.Remove(cum); + } + removecums.Clear(); + return outcum; + } + + + public bool FertilizationCheck() + { + if (!eggs.NullOrEmpty()) + { + bool onefertilized = false; + foreach (Egg egg in eggs) + { + if (!egg.fertilized) egg.fertilizer = Fertilize(); + if (egg.fertilizer != null) { + egg.fertilized = true; + onefertilized = true; + } + } + return onefertilized; + } + else return false; + } + + private Pawn Fertilize() + { + if (cums.NullOrEmpty()) return null; + foreach (Cum cum in cums) + { + float rand = Rand.Range(0.0f, 1.0f); + if (!cum.notcum && rand < cum.fertvolume * cum.fertFactor * Configurations.FertilizeChance * Props.basefertilizationChanceFactor) + { + return cum.pawn; + } + } + return null; + } + + + //for now, only one egg can be implanted + private bool Implant() + { + if (!eggs.NullOrEmpty()) + { + List deadeggs = new List(); + bool pregnant = false; + foreach(Egg egg in eggs) + { + if (!egg.fertilized) continue; + else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * Props.baseImplantationChanceFactor * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer)) + { + PregnancyHelper.PregnancyDecider(parent.pawn, egg.fertilizer); + pregnant = true; + break; + } + else deadeggs.Add(egg); + } + + if (pregnant) + { + eggs.Clear(); + deadeggs.Clear(); + return true; + } + else if (!deadeggs.NullOrEmpty()) + { + foreach (Egg egg in deadeggs) + { + eggs.Remove(egg); + } + deadeggs.Clear(); + } + } + return false; + } + + private void BleedOut() + { + //FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label); + CumIn(parent.pawn, Rand.Range(0f, 20f), Translations.Menstrual_Blood,-4.0f,ThingDefOf.Filth_Blood); + GetNotCum(Translations.Menstrual_Blood).color = Colors.blood; + } + + private void MakeCumFilth(Cum cum) + { + FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort); + } + + + + private void EggDecay() + { + List deadeggs = new List(); + foreach (Egg egg in eggs) + { + egg.lifespanhrs--; + if (egg.lifespanhrs < 0) deadeggs.Add(egg); + } + + if (!deadeggs.NullOrEmpty()) + { + foreach (Egg egg in deadeggs) + { + eggs.Remove(egg); + } + deadeggs.Clear(); + } + } + + + private Action PeriodSimulator(Enum targetstage) + { + Action action = null; + switch (targetstage) + { + case Stage.Follicular: + action = delegate + { + if (curStageHrs >= (follicularIntervalhours - bleedingIntervalhours) * CycleFactor) + { + GoNextStage(Stage.Ovulatory); + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + case Stage.Ovulatory: + action = delegate + { + eggs.Add(new Egg(Props.eggLifespanDays * 24)); + lutealIntervalhours = PeriodRandomizer(lutealIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Luteal); + }; + break; + case Stage.Luteal: + action = delegate + { + if (!eggs.NullOrEmpty()) + { + if (FertilizationCheck()) + { + GoNextStage(Stage.Fertilized); + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + } + else if (curStageHrs <= lutealIntervalhours) + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + else + { + bleedingIntervalhours = PeriodRandomizer(bleedingIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Bleeding); + } + }; + break; + case Stage.Bleeding: + action = delegate + { + if (curStageHrs >= bleedingIntervalhours) + { + follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Follicular); + } + else + { + if (curStageHrs < bleedingIntervalhours / 6) for (int i = 0; i < Configurations.CycleAcceleration; i++) BleedOut(); + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + case Stage.Fertilized: + action = delegate + { + if (curStageHrs >= 24) + { + if (Implant()) + { + GoNextStage(Stage.Pregnant); + } + else + { + GoNextStageSetHour(Stage.Luteal, 96); + } + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + case Stage.Pregnant: + action = delegate + { + if (parent.pawn.IsPregnant()) StayCurrentStageConst(Stage.Pregnant); + else GoNextStage(Stage.Recover); + }; + break; + case Stage.Recover: + action = delegate + { + if (curStageHrs >= recoveryIntervalhours) + { + follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Follicular); + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + default: + curStage = Stage.Follicular; + curStageHrs = 0; + if (follicularIntervalhours < 0) follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24, Props.deviationFactor); + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Follicular), tickInterval, parent.pawn, false); + break; + } + action += () => + { + CumOut(); + if (!eggs.NullOrEmpty()) EggDecay(); + }; + + actionref = action; + return action; + + void GoNextStage(Stage nextstage, float factor = 1.0f) + { + curStageHrs = 0; + curStage = nextstage; + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false); + } + + void GoNextStageSetHour(Stage nextstage, int hour, float factor = 1.0f) + { + curStageHrs = hour; + curStage = nextstage; + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false); + } + + void StayCurrentStage(float factor = 1.0f) + { + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), (int)(tickInterval * factor), parent.pawn, false); + } + + void StayCurrentStageConst(Stage curstage, float factor = 1.0f) + { + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curstage), (int)(tickInterval * factor), parent.pawn, false); + } + + + } + + + private int PeriodRandomizer(int intervalhours, float deviation) + { + return intervalhours + (int)(intervalhours*Rand.Range(-deviation,deviation)); + } + + private float InterspeciesImplantFactor(Pawn fertilizer) + { + if (RJWPregnancySettings.complex_interspecies) return SexUtility.BodySimilarity(parent.pawn, fertilizer); + else return RJWPregnancySettings.interspecies_impregnation_modifier; + } + + private Stage RandomStage() + { + int rand = Rand.Range(0,2); + + switch (rand) + { + case 0: + curStageHrs = Rand.Range(0, (Props.folicularIntervalDays - Props.bleedingIntervalDays) * 24); + return Stage.Follicular; + case 1: + curStageHrs = Rand.Range(0, Props.eggLifespanDays * 24); + return Stage.Luteal; + case 2: + curStageHrs = Rand.Range(0, Props.bleedingIntervalDays * 24); + return Stage.Bleeding; + default: return Stage.Follicular; + } + + + } + + + + public class Egg : IExposable + { + public bool fertilized; + public int lifespanhrs; + public Pawn fertilizer; + + public Egg() + { + fertilized = false; + lifespanhrs = 96; + fertilizer = null; + } + + public Egg(int lifespanhrs) + { + fertilized = false; + this.lifespanhrs = lifespanhrs; + fertilizer = null; + } + + public void ExposeData() + { + Scribe_References.Look(ref fertilizer, "fertilizer", true); + Scribe_Values.Look(ref fertilized, "fertilized", fertilized, true); + Scribe_Values.Look(ref lifespanhrs, "lifespanhrs", lifespanhrs, true); + } + } + + + } +} diff --git a/source/RJW Menstruation/RJW_Menstruation/RJW_Menstruation.csproj b/source/RJW Menstruation/RJW_Menstruation/RJW_Menstruation.csproj new file mode 100644 index 0000000..22b1d26 --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/RJW_Menstruation.csproj @@ -0,0 +1,350 @@ + + + + + Debug + AnyCPU + {EED2F3B9-8C20-4194-919E-8D151B29F70B} + Library + RJW_Menstruation + RJW_Menstruation + v4.7.2 + 512 + true + true + 게시\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + false + ..\..\..\Assemblies\ + DEBUG;TRACE + prompt + 4 + false + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + D:\잉어\Lib\Harmony.2.0.4.0\net472\0Harmony.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll + False + + + ..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.2\Assemblies\HugsLib.dll + False + + + ..\..\..\..\RJW\1.1\Assemblies\RJW.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\Unity.TextMeshPro.dll + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AccessibilityModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AndroidJNIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AnimationModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ARModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AssetBundleModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AudioModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClothModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterInputModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterRendererModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CrashReportingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DirectorModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DSPGraphModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.FileSystemHttpModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GameCenterModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GridModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.HotReloadModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ImageConversionModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputLegacyModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.JSONSerializeModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.LocalizationModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ParticleSystemModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PerformanceReportingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.Physics2DModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PhysicsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ProfilerModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ScreenCaptureModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SharedInternalsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteMaskModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteShapeModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.StreamingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SubstanceModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextCoreModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextRenderingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TilemapModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TLSModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UI.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIElementsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UmbraModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UNETModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityConnectModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VehiclesModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VFXModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VideoModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VRModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.WindModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.XRModule.dll + False + + + + + False + Microsoft .NET Framework 4.7.2%28x86 및 x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + \ No newline at end of file diff --git a/source/RJW Menstruation/RJW_Menstruation/RJW_Patch.cs b/source/RJW Menstruation/RJW_Menstruation/RJW_Patch.cs new file mode 100644 index 0000000..894f3ae --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/RJW_Patch.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using HarmonyLib; +using rjw; +using Verse; + + +namespace RJW_Menstruation +{ + + [HarmonyPatch(typeof(PregnancyHelper), "impregnate")] + public static class impregnate_Patch + { + public static bool Prefix(Pawn pawn, Pawn partner, xxx.rjwSextype sextype = xxx.rjwSextype.None) + { + if (sextype == xxx.rjwSextype.Vaginal) + { + var pawnpartBPR = Genital_Helper.get_genitalsBPR(pawn); + var pawnparts = Genital_Helper.get_PartsHediffList(pawn, pawnpartBPR); + var partnerpartBPR = Genital_Helper.get_genitalsBPR(partner); + var partnerparts = Genital_Helper.get_PartsHediffList(partner, partnerpartBPR); + + if (Genital_Helper.has_vagina(partner, partnerparts)) + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner); + if (comp != null) + { + if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && PregnancyHelper.CanImpregnate(pawn, partner, sextype)) + { + PregnancyHelper.Doimpregnate(pawn, partner); + return false; + } + else comp.CumIn(pawn, Utility.GetCumVolume(pawn), 0); + } + } + else if (Genital_Helper.has_vagina(pawn, pawnparts)) + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn); + if (comp != null) + { + if (Genital_Helper.has_penis_fertile(partner, partnerparts) && PregnancyHelper.CanImpregnate(partner, pawn, sextype)) + { + PregnancyHelper.Doimpregnate(partner, pawn); + return false; + } + else comp.CumIn(partner, Utility.GetCumVolume(partner), 0); + } + } + } + return true; + + + } + } + + [HarmonyPatch(typeof(PregnancyHelper), "Doimpregnate")] + public static class Doimpregnate_Patch + { + public static bool Prefix(Pawn pawn, Pawn partner) // partner has vagina + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner); + if (comp != null) + { + if (AndroidsCompatibility.IsAndroid(pawn) && !AndroidsCompatibility.AndroidPenisFertility(pawn)) + { + comp.CumIn(pawn, Utility.GetCumVolume(pawn),0); + return false; + } + else comp.CumIn(pawn, Utility.GetCumVolume(pawn), pawn.health.capacities.GetLevel(xxx.reproduction)); + return false; + } + ModLog.Message("used original rjw method: Comp missing"); + return true; + } + } + + + + + + + + + +} diff --git a/source/RJW Menstruation/RJW_Menstruation/Translations.cs b/source/RJW Menstruation/RJW_Menstruation/Translations.cs new file mode 100644 index 0000000..6e524ba --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/Translations.cs @@ -0,0 +1,60 @@ +using Verse; + +namespace RJW_Menstruation +{ + public static class Translations + { + public static readonly string Mod_Title = "Mod_Title".Translate(); + public static readonly string Info_noCum = "Info_noCum".Translate(); + public static readonly string Menstrual_Blood = "Menstrual_Blood".Translate(); + public static readonly string Stage_Follicular = "Stage_Follicular".Translate(); + public static readonly string Stage_Ovulatory = "Stage_Ovulatory".Translate(); + public static readonly string Stage_Luteal = "Stage_Luteal".Translate(); + public static readonly string Stage_Bleeding = "Stage_Bleeding".Translate(); + public static readonly string Stage_Fertilized = "Stage_Fertilized".Translate(); + public static readonly string Stage_Pregnant = "Stage_Pregnant".Translate(); + public static readonly string Stage_Recover = "Stage_Recover".Translate(); + + public static readonly string Dialog_WombInfo01 = "Dialog_WombInfo01".Translate(); + public static readonly string Dialog_WombInfo02 = "Dialog_WombInfo02".Translate(); + public static readonly string Dialog_WombInfo03 = "Dialog_WombInfo03".Translate(); + public static readonly string Dialog_WombInfo04 = "Dialog_WombInfo04".Translate(); + public static readonly string Dialog_WombInfo05 = "Dialog_WombInfo05".Translate(); + public static readonly string Dialog_WombInfo06 = "Dialog_WombInfo06".Translate(); + public static readonly string Dialog_WombInfo07 = "Dialog_WombInfo07".Translate(); + public static readonly string Dialog_WombInfo08 = "Dialog_WombInfo08".Translate(); + public static readonly string Dialog_WombInfo09 = "Dialog_WombInfo09".Translate(); + public static readonly string Dialog_WombInfo10 = "Dialog_WombInfo10".Translate(); + + + public static readonly string Option1_Label = "Option1_Label".Translate(); + public static readonly string Option1_Desc = "Option1_Desc".Translate(); + public static readonly string Option2_Label = "Option2_Label".Translate(); + public static readonly string Option2_Desc = "Option2_Desc".Translate(); + public static readonly string Option3_Label = "Option3_Label".Translate(); + public static readonly string Option3_Desc = "Option3_Desc".Translate(); + public static readonly string Option4_Label = "Option4_Label".Translate(); + public static readonly string Option4_Desc = "Option4_Desc".Translate(); + public static readonly string Option5_Label = "Option5_Label".Translate(); + public static readonly string Option5_Desc = "Option5_Desc".Translate(); + public static readonly string Option6_Label = "Option6_Label".Translate(); + public static readonly string Option6_Desc = "Option6_Desc".Translate(); + public static readonly string Option7_Label = "Option7_Label".Translate(); + public static readonly string Option7_Desc = "Option7_Desc".Translate(); + public static readonly string Option8_Label = "Option8_Label".Translate(); + public static readonly string Option8_Desc = "Option8_Desc".Translate(); + public static readonly string Option9_Label = "Option9_Label".Translate(); + public static readonly string Option9_Desc = "Option9_Desc".Translate(); + public static readonly string Option10_Label = "Option10_Label".Translate(); + public static readonly string Option10_Desc = "Option10_Desc".Translate(); + public static readonly string Option11_Label = "Option11_Label".Translate(); + public static readonly string Option11_Desc = "Option11_Desc".Translate(); + public static readonly string Option12_Label = "Option12_Label".Translate(); + public static readonly string Option12_Desc = "Option12_Desc".Translate(); + public static readonly string Option13_Label = "Option13_Label".Translate(); + public static readonly string Option13_Desc = "Option13_Desc".Translate(); + + + + } +} diff --git a/source/RJW Menstruation/RJW_Menstruation/Utility.cs b/source/RJW Menstruation/RJW_Menstruation/Utility.cs new file mode 100644 index 0000000..3723868 --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/Utility.cs @@ -0,0 +1,223 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using rjw; +using RimWorld; +using UnityEngine; + +namespace RJW_Menstruation +{ + public static class Colors + { + public static Color blood = new Color(0.78f, 0, 0); + } + + + public static class Utility + { + + public static float GetCumVolume(Pawn pawn) + { + CompHediffBodyPart part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("penis")).InRandomOrder().FirstOrDefault().TryGetComp(); + if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorf")).InRandomOrder().FirstOrDefault().TryGetComp(); + if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorm")).InRandomOrder().FirstOrDefault().TryGetComp(); + if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("tentacle")).InRandomOrder().FirstOrDefault().TryGetComp(); + + return part?.FluidAmmount * part.FluidModifier * Rand.Range(0.8f, 1.2f) ?? 0.0f; + } + + public static HediffComp_Menstruation GetMenstruationComp(Pawn pawn) + { + var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + HediffComp_Menstruation result; + if (hedifflist.NullOrEmpty()) return null; + else + { + foreach (Hediff h in hedifflist) + { + result = h.TryGetComp(); + if (result != null) return result; + } + } + return null; + } + + public static bool HasMenstruationComp(Pawn pawn) + { + var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + HediffComp_Menstruation result; + if (hedifflist.NullOrEmpty()) return false; + else + { + foreach (Hediff h in hedifflist) + { + result = h.TryGetComp(); + if (result != null) return true; + } + } + return false; + } + + + public static HediffComp_Menstruation.Stage GetCurStage(Pawn pawn) + { + return GetMenstruationComp(pawn)?.curStage ?? HediffComp_Menstruation.Stage.Bleeding; + } + + + public static float GetPregnancyProgress(Pawn pawn) + { + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + return h.GestationProgress; + } + return -1; + } + + public static Pawn GetFetus(Pawn pawn) + { + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + return h?.babies?.First() ?? null; + } + //else if (hediff is Hediff_HumanlikePregnancy) + //{ + // Hediff_HumanlikePregnancy h = (Hediff_HumanlikePregnancy)hediff; + // return h?.babies?.First() ?? null; + //} + //else if (hediff is Hediff_BestialPregnancy) + //{ + // Hediff_BestialPregnancy h = (Hediff_BestialPregnancy)hediff; + // return h?.babies?.First() ?? null; + //} + else if (hediff is Hediff_MechanoidPregnancy) + { + Hediff_MechanoidPregnancy h = (Hediff_MechanoidPregnancy)hediff; + return h?.babies?.First() ?? null; + } + + + return null; + } + + + + public static Texture2D GetPregnancyIcon(HediffComp_Menstruation comp, Hediff hediff) + { + string icon = ""; + if (hediff is Hediff_MechanoidPregnancy) + { + return ContentFinder.Get(("Womb/Mechanoid_Fluid"), true); + } + else if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + string fetustex = DefDatabase.GetNamedSilentFail(h.babies.First().def.defName)?.fetusTexPath ?? "Fetus/Fetus_Default"; + if (h.GestationProgress < 0.2f) icon = comp.Props.wombTex + "_Implanted"; + else if (h.GestationProgress < 0.3f) icon += "Fetus/Fetus_Early00"; + else if (h.GestationProgress < 0.4f) icon += fetustex + "00"; + else if (h.GestationProgress < 0.5f) icon += fetustex + "01"; + else if (h.GestationProgress < 0.6f) icon += fetustex + "02"; + else if (h.GestationProgress < 0.7f) icon += fetustex + "03"; + else if (h.GestationProgress < 0.8f) icon += fetustex + "04"; + else icon += fetustex + "05"; + } + else icon = "Fetus/Slime_Abomi02"; + return ContentFinder.Get((icon), true); + } + + public static Texture2D GetCumIcon(HediffComp_Menstruation comp) + { + string icon = "Womb/"; + float cumpercent = comp.TotalCumPercent; + if (cumpercent < 0.001f) icon += "Empty"; + else if (cumpercent < 0.01f) icon += "Cum_00"; + else if (cumpercent < 0.05f) icon += "Cum_01"; + else if (cumpercent < 0.11f) icon += "Cum_02"; + else if (cumpercent < 0.17f) icon += "Cum_03"; + else if (cumpercent < 0.23f) icon += "Cum_04"; + else if (cumpercent < 0.29f) icon += "Cum_05"; + else if (cumpercent < 0.35f) icon += "Cum_06"; + else if (cumpercent < 0.41f) icon += "Cum_07"; + else if (cumpercent < 0.47f) icon += "Cum_08"; + else if (cumpercent < 0.53f) icon += "Cum_09"; + else if (cumpercent < 0.59f) icon += "Cum_10"; + else if (cumpercent < 0.65f) icon += "Cum_11"; + else if (cumpercent < 0.71f) icon += "Cum_12"; + else if (cumpercent < 0.77f) icon += "Cum_13"; + else if (cumpercent < 0.83f) icon += "Cum_14"; + else if (cumpercent < 0.89f) icon += "Cum_15"; + else if (cumpercent < 0.95f) icon += "Cum_16"; + else icon += "Cum_17"; + Texture2D cumtex = ContentFinder.Get((icon), true); + return cumtex; + } + + public static Texture2D GetWombIcon(HediffComp_Menstruation comp) + { + string icon = comp.Props.wombTex; + HediffComp_Menstruation.Stage stage = comp.curStage; + if (stage == HediffComp_Menstruation.Stage.Bleeding) icon += "_Bleeding"; + + Texture2D wombtex = ContentFinder.Get((icon), true); + + return wombtex; + } + + public static Texture2D GetGenitalIcon(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + string icon = "Genitals/"; + if (hediff.Severity < 0.20f) icon += "Vagina00"; //micro + else if (hediff.Severity < 0.30f) icon += "Vagina01"; //tight + else if (hediff.Severity < 0.40f) icon += "Vagina02"; //tight + else if (hediff.Severity < 0.47f) icon += "Vagina03"; //average + else if (hediff.Severity < 0.53f) icon += "Vagina04"; //average + else if (hediff.Severity < 0.60f) icon += "Vagina05"; //average + else if (hediff.Severity < 0.70f) icon += "Vagina06"; //accomodating + else if (hediff.Severity < 0.80f) icon += "Vagina07"; //accomodating + else if (hediff.Severity < 0.87f) icon += "Vagina08"; //cavernous + else if (hediff.Severity < 0.94f) icon += "Vagina09"; //cavernous + else if (hediff.Severity < 1.01f) icon += "Vagina10"; //cavernous + else icon += "Vagina11"; //abyssal + + return ContentFinder.Get((icon), true); + } + + public static Texture2D GetAnalIcon(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus")); + string icon = "Genitals/"; + if (hediff.Severity < 0.20f) icon += "Anal00"; //micro + else if (hediff.Severity < 0.40f) icon += "Anal01"; //tight + else if (hediff.Severity < 0.60f) icon += "Anal02"; //average + else if (hediff.Severity < 0.80f) icon += "Anal03"; //accomodating + else if (hediff.Severity < 1.01f) icon += "Anal04"; //cavernous + else icon += "Anal05"; //abyssal + + return ContentFinder.Get((icon), true); + } + + public static string GetVaginaLabel(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + return hediff.LabelBase + "\n" + hediff.LabelInBrackets; + } + public static string GetAnusLabel(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus")); + return hediff.Label; + } + + + + + } +} diff --git a/source/RJW Menstruation/RJW_Menstruation/VariousDefOf.cs b/source/RJW Menstruation/RJW_Menstruation/VariousDefOf.cs new file mode 100644 index 0000000..e84a4da --- /dev/null +++ b/source/RJW Menstruation/RJW_Menstruation/VariousDefOf.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using rjw; + +namespace RJW_Menstruation +{ + public static class VariousDefOf + { + public static readonly DNADef defaultDNA = new DNADef + { + fetusTexPath = "Fetus/Fetus_Default", + cumColor = new ColorInt(255, 255, 255, 255), + cumTickness = 0 + }; + + public static readonly ThingDef CumFilth = DefDatabase.GetNamed("FilthCum"); + public static readonly HediffDef RJW_IUD = DefDatabase.GetNamed("RJW_IUD"); + + } +} diff --git a/source/RJW_Menstruation/RJW_Menstruation.sln b/source/RJW_Menstruation/RJW_Menstruation.sln new file mode 100644 index 0000000..99c2de2 --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30907.101 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RJW_Menstruation", "RJW_Menstruation\RJW_Menstruation.csproj", "{0E3D82EC-3048-43DC-8C7A-6377671928FA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0E3D82EC-3048-43DC-8C7A-6377671928FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E3D82EC-3048-43DC-8C7A-6377671928FA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E3D82EC-3048-43DC-8C7A-6377671928FA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E3D82EC-3048-43DC-8C7A-6377671928FA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0E4B1D09-2A81-4440-AC1E-32ACCECBEE0B} + EndGlobalSection +EndGlobal diff --git a/source/RJW_Menstruation/RJW_Menstruation/App.config b/source/RJW_Menstruation/RJW_Menstruation/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs b/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs new file mode 100644 index 0000000..c765e78 --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; + +namespace RJW_Menstruation +{ + public class Configurations : ModSettings + { + public static readonly float ImplantationChanceDefault = 0.25f; + public static readonly int ImplantationChanceAdjustDefault = 25; + public static readonly float FertilizeChanceDefault = 0.05f; + public static readonly int FertilizeChanceAdjustDefault = 50; + public static readonly float CumDecayRatioDefault = 0.05f; + public static readonly int CumDecayRatioAdjustDefault = 50; + public static readonly float CumFertilityDecayRatioDefault = 0.2f; + public static readonly int CumFertilityDecayRatioAdjustDefault = 200; + public static readonly int CycleAccelerationDefault = 6; + + public static float ImplantationChance = ImplantationChanceDefault; + public static int ImplantationChanceAdjust = ImplantationChanceAdjustDefault; + public static float FertilizeChance = FertilizeChanceDefault; + public static int FertilizeChanceAdjust = FertilizeChanceAdjustDefault; + public static float CumDecayRatio = CumDecayRatioDefault; + public static int CumDecayRatioAdjust = CumDecayRatioAdjustDefault; + public static float CumFertilityDecayRatio = CumFertilityDecayRatioDefault; + public static int CumFertilityDecayRatioAdjust = CumFertilityDecayRatioAdjustDefault; + public static int CycleAcceleration = CycleAccelerationDefault; + public static bool EnableWombIcon = true; + public static bool EnableAnimalCycle = false; + public static bool Debug = false; + + public override void ExposeData() + { + Scribe_Values.Look(ref ImplantationChanceAdjust, "ImplantationChanceAdjust", ImplantationChanceAdjust, true); + Scribe_Values.Look(ref ImplantationChance, "ImplantationChance", ImplantationChance, true); + Scribe_Values.Look(ref FertilizeChanceAdjust, "FertilizeChanceAdjust", FertilizeChanceAdjust, true); + Scribe_Values.Look(ref FertilizeChance, "FertilizeChance", FertilizeChance, true); + Scribe_Values.Look(ref CumDecayRatioAdjust, "CumDecayRatioAdjust", CumDecayRatioAdjust, true); + Scribe_Values.Look(ref CumDecayRatio, "CumDecayRatio", CumDecayRatio, true); + Scribe_Values.Look(ref CumFertilityDecayRatioAdjust, "CumFertilityDecayRatioAdjust", CumFertilityDecayRatioAdjust, true); + Scribe_Values.Look(ref CumFertilityDecayRatio, "CumFertilityDecayRatio", CumFertilityDecayRatio, true); + Scribe_Values.Look(ref EnableWombIcon, "EnableWombIcon", EnableWombIcon, true); + Scribe_Values.Look(ref EnableAnimalCycle, "EnableAnimalCycle", EnableAnimalCycle, true); + base.ExposeData(); + } + + + } + + + public class RJW_Menstruation : Mod + { + + private readonly Configurations config; + public RJW_Menstruation(ModContentPack content) : base(content) + { + config = GetSettings(); + + } + + public override string SettingsCategory() + { + return Translations.Mod_Title; + } + + public override void DoSettingsWindowContents(Rect inRect) + { + Rect mainRect = inRect.ContractedBy(20f); + Listing_Standard listmain = new Listing_Standard(); + listmain.Begin(mainRect); + + listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc); + + listmain.CheckboxLabeled(Translations.Option2_Label, ref Configurations.EnableAnimalCycle, Translations.Option2_Desc); + + listmain.Label(Translations.Option3_Label + " " + Configurations.ImplantationChance*100 + "%", -1, Translations.Option3_Desc); + Configurations.ImplantationChanceAdjust = (int)listmain.Slider(Configurations.ImplantationChanceAdjust, 0, 1000); + Configurations.ImplantationChance = (float)Configurations.ImplantationChanceAdjust/100; + + listmain.Label(Translations.Option4_Label + " " + Configurations.FertilizeChance*100 + "%", -1, Translations.Option4_Desc); + Configurations.FertilizeChanceAdjust = (int)listmain.Slider(Configurations.FertilizeChanceAdjust, 0, 1000); + Configurations.FertilizeChance = (float)Configurations.FertilizeChanceAdjust/1000; + + listmain.Label(Translations.Option5_Label + " " + Configurations.CumDecayRatio*100 + "%", -1, Translations.Option5_Desc); + Configurations.CumDecayRatioAdjust = (int)listmain.Slider(Configurations.CumDecayRatioAdjust, 0, 1000); + Configurations.CumDecayRatio = (float)Configurations.CumDecayRatioAdjust/1000; + + listmain.Label(Translations.Option6_Label + " " + Configurations.CumFertilityDecayRatio*100 + "%", -1, Translations.Option6_Desc); + Configurations.CumFertilityDecayRatioAdjust = (int)listmain.Slider(Configurations.CumFertilityDecayRatioAdjust, 0, 1000); + Configurations.CumFertilityDecayRatio = (float)Configurations.CumFertilityDecayRatioAdjust/1000; + + listmain.Label(Translations.Option7_Label + " x" + Configurations.CycleAcceleration, -1, Translations.Option7_Desc); + Configurations.CycleAcceleration = (int)listmain.Slider(Configurations.CycleAcceleration,1,50); + + + listmain.CheckboxLabeled(Translations.Option8_Label, ref Configurations.Debug, Translations.Option8_Desc); + if (listmain.ButtonText("reset to default")) + { + Configurations.ImplantationChanceAdjust = Configurations.ImplantationChanceAdjustDefault; + Configurations.FertilizeChanceAdjust = Configurations.FertilizeChanceAdjustDefault; + Configurations.CumDecayRatioAdjust = Configurations.CumDecayRatioAdjustDefault; + Configurations.CumFertilityDecayRatioAdjust = Configurations.CumFertilityDecayRatioAdjustDefault; + Configurations.EnableWombIcon = true; + Configurations.EnableAnimalCycle = false; + Configurations.CycleAcceleration = Configurations.CycleAccelerationDefault; + } + + + listmain.End(); + + + } + + + } + + + + +} diff --git a/source/RJW_Menstruation/RJW_Menstruation/Cum.cs b/source/RJW_Menstruation/RJW_Menstruation/Cum.cs new file mode 100644 index 0000000..3fbb33f --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/Cum.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using UnityEngine; +using rjw; + +namespace RJW_Menstruation +{ + public class Cum : IExposable + { + public Pawn pawn; + + //public bool failedFertilization = false; + //public bool dead = false; + public float volume; // ml + public float fertvolume; + public float fertFactor = 1.0f; + public bool notcum = false; // for other fluids + public string notcumLabel = ""; + private bool useCustomColor = false; + private float notcumthickness = 0; + public float decayresist + { + get + { + if (!notcum) return DNA.cumTickness; + else return notcumthickness; + } + set + { + notcumthickness = value; + } + } + private Color customColor; + public DNADef DNA + { + get + { + if (DNAcache == null) + { + DNAcache = DefDatabase.GetNamedSilentFail(pawn.def.defName); + if (DNAcache == null) + { + DNAcache = VariousDefOf.defaultDNA; + } + return DNAcache; + } + else return DNAcache; + } + } + private DNADef DNAcache = null; + public ThingDef FilthDef + { + get + { + if (filthDef == null) return VariousDefOf.CumFilth; + else return filthDef; + } + set + { + filthDef = value; + } + } + private ThingDef filthDef = null; + public Color color + { + get + { + if (!useCustomColor) return DNA.CumColor; + else return customColor; + } + + set + { + useCustomColor = true; + customColor = value; + } + } + + + public Cum() {} + + public Cum(Pawn pawn) + { + this.pawn = pawn; + volume = 1.0f; + fertvolume = 1.0f; + decayresist = 0; + } + + public Cum(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthDef = null) + { + this.pawn = pawn; + this.volume = volume; + this.fertvolume = volume; + this.notcum = true; + this.notcumLabel = notcumlabel; + this.notcumthickness = decayresist; + this.filthDef = filthDef; + } + + public Cum(Pawn pawn, float volume, float fertility, ThingDef filthDef = null) + { + this.pawn = pawn; + this.volume = volume; + if (fertility > 0) + { + this.fertvolume = volume; + this.fertFactor = fertility; + } + else this.fertvolume = 0; + this.filthDef = filthDef; + } + + + + public void ExposeData() + { + Scribe_References.Look(ref pawn, "pawn", true); + Scribe_Values.Look(ref volume, "volume", volume, true); + Scribe_Values.Look(ref fertvolume, "fertvolume", fertvolume, true); + Scribe_Values.Look(ref notcumthickness, "notcumthickness", notcumthickness, true); + Scribe_Values.Look(ref fertFactor, "fertFactor", fertFactor, true); + Scribe_Values.Look(ref notcum, "notcum", notcum, true); + Scribe_Values.Look(ref notcumLabel, "notcumLabel", notcumLabel, true); + Scribe_Values.Look(ref useCustomColor, "useCustomColor", useCustomColor, true); + Scribe_Values.Look(ref customColor, "customColor", customColor, true); + + } + } + + + + + + +} diff --git a/source/RJW_Menstruation/RJW_Menstruation/DNADef.cs b/source/RJW_Menstruation/RJW_Menstruation/DNADef.cs new file mode 100644 index 0000000..5f19368 --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/DNADef.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using UnityEngine; + + +namespace RJW_Menstruation +{ + public class DNADef : Def + { + public bool IsNone => string.IsNullOrEmpty(defName); + public static readonly DNADef None = new DNADef(); + + public string fetusTexPath; + public ColorInt cumColor; + public Color CumColor => cumColor.ToColor; + public float cumTickness = 0f; + + } + + + +} diff --git a/source/RJW_Menstruation/RJW_Menstruation/Dialog_WombStatus.cs b/source/RJW_Menstruation/RJW_Menstruation/Dialog_WombStatus.cs new file mode 100644 index 0000000..6ed4294 --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/Dialog_WombStatus.cs @@ -0,0 +1,204 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; +using RimWorld; +using rjw; + +namespace RJW_Menstruation +{ + public class Dialog_WombStatus : Window + { + private Pawn pawn; + private HediffComp_Menstruation comp; + private const float windowMargin = 20f; + private const float pawnRectWidth = 150f; + private const float pawnRectHeight = 150f; + private const float wombRectHeight = 270f; + private const float wombRectWidth = 300f; + private const float fontheight = 30; + private const float genitalRectWidth = 102; + private const float genitalRectHeight = 140; + + + private Texture2D womb; + private Texture2D cum; + private Texture2D vagina; + private Texture2D anal; + private Color cumcolor; + + public override Vector2 InitialSize + { + get + { + return new Vector2(300f + 2*windowMargin,800f); + } + } + + public Dialog_WombStatus(Pawn pawn, HediffComp_Menstruation comp, Texture2D icon) + { + this.pawn = pawn; + this.comp = comp; + womb = icon; + } + + public override void DoWindowContents(Rect inRect) + { + bool flag = false; + soundClose = SoundDefOf.InfoCard_Close; + //closeOnClickedOutside = true; + absorbInputAroundWindow = false; + forcePause = false; + preventCameraMotion = false; + draggable = true; + //resizeable = true; + + if (Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.Escape)) + { + flag = true; + Event.current.Use(); + } + + Rect windowRect = inRect.ContractedBy(windowMargin); + Rect mainRect = new Rect(windowRect.x, windowRect.y, windowRect.width, windowRect.height - 20f); + Rect closeRect = new Rect(windowRect.xMax, 0f, 20f, 20f); + MainContents(mainRect); + if (Widgets.CloseButtonFor(closeRect)) + { + Close(); + } + } + + private void MainContents(Rect mainRect) + { + GUIStyle fontstylecenter = new GUIStyle() { alignment = TextAnchor.MiddleCenter }; + GUIStyle fontstyleright = new GUIStyle() { alignment = TextAnchor.MiddleRight }; + GUIStyle fontstyleleft = new GUIStyle() { alignment = TextAnchor.MiddleLeft }; + GUIStyle boxstyle = new GUIStyle(GUI.skin.textArea); + GUIStyle buttonstyle = new GUIStyle(GUI.skin.button); + boxstyle.hover = boxstyle.normal; + boxstyle.onHover = boxstyle.normal; + boxstyle.onNormal = boxstyle.normal; + + buttonstyle.onHover = buttonstyle.onNormal; + buttonstyle.hover = buttonstyle.normal; + boxstyle.border.left = 4; boxstyle.border.right = 4; boxstyle.border.bottom = 4; boxstyle.border.top = 4; + + float preginfoheight = 0f; + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + if (pawn.IsPregnant()) + { + womb = Utility.GetPregnancyIcon(comp, hediff); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + if (h.GestationProgress < 0.2f) cum = Utility.GetCumIcon(comp); + else cum = ContentFinder.Get(("Womb/Empty"), true); + Pawn fetus = Utility.GetFetus(pawn); + preginfoheight = fontheight; + Rect preginfo = new Rect(0f, mainRect.yMax - wombRectHeight - 2, wombRectWidth, preginfoheight); + if (fetus != null) + { + fontstyleright.normal.textColor = Color.white; + buttonstyle.alignment = TextAnchor.MiddleLeft; + GUI.Box(preginfo, h.babies.Count + " " + fetus.def.label + " " + Translations.Dialog_WombInfo02, buttonstyle); + GUI.Label(preginfo, Translations.Dialog_WombInfo03 + ": " + h.father.LabelShort + " ", fontstyleright); + } + + } + else cum = ContentFinder.Get(("Womb/Empty"), true); + } + else + { + womb = Utility.GetWombIcon(comp); + cum = Utility.GetCumIcon(comp); + } + + + Rect pawnRect = new Rect(0, 0, pawnRectWidth, pawnRectHeight); + Widgets.DrawTextureFitted(pawnRect,PortraitsCache.Get(pawn, pawnRect.size),1.0f); + Rect pawnLabelRect = new Rect(0, pawnRectHeight, pawnRectWidth, fontheight-10); + Rect pawnLabel2Rect = new Rect(0, pawnRectHeight+fontheight-10, pawnRectWidth, fontheight-10); + fontstylecenter.normal.textColor = pawn.DrawColor; + GUI.Label(pawnLabelRect, pawn.Name.ToStringFull, fontstylecenter); + GUI.Label(pawnLabel2Rect, pawn.story.Title, fontstylecenter); + GUI.color = Color.white; + + + Rect wombInfoRect = new Rect(0f, mainRect.yMax - wombRectHeight - fontheight - 2, wombRectWidth, fontheight); + + buttonstyle.normal.textColor = Color.white; + //boxstyle.normal.background = Texture2D.whiteTexture; + buttonstyle.alignment = TextAnchor.MiddleLeft; + GUI.backgroundColor = new Color(0.24f, 0.29f, 0.35f, 1); + GUI.Box(wombInfoRect, Translations.Dialog_WombInfo01 + ": " + comp.GetCurStageLabel,buttonstyle); + GUI.color = Color.white; + + + fontstyleright.normal.textColor = Color.red; + if (comp.GetFertilization) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo05 + " ", fontstyleright); + else if (comp.GetEggFertilizing) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo06 + " ", fontstyleright); + else if (comp.GetEgg) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo07 + " ", fontstyleright); + + //Widgets.Label(wombInfoRect,Translations.Dialog_WombInfo01 + ": " + comp.GetCurStageLabel); + + + cumcolor = comp.GetCumMixtureColor; + Rect wombRect = new Rect(0f, mainRect.yMax - wombRectHeight + preginfoheight, wombRectWidth, wombRectHeight); + GUI.color = new Color(1.00f,0.47f,0.47f,1); + GUI.Box(wombRect,"",boxstyle); + //GUI.color = Color.white; + //Widgets.DrawTextureFitted(wombRect, womb,1.0f); + //GUI.color = cumcolor; + //Widgets.DrawTextureFitted(wombRect, cum,1.0f); + GUI.DrawTexture(wombRect, womb, ScaleMode.ScaleToFit, true, 0, Color.white, 0, 0); + GUI.DrawTexture(wombRect, cum, ScaleMode.ScaleToFit, true, 0, cumcolor,0,0); + GUI.color = Color.white; + + Rect cumlistTitle = new Rect(pawnRectWidth, 0, wombRectWidth - pawnRectWidth, fontheight); + GUI.Label(cumlistTitle,Translations.Dialog_WombInfo04); + + Rect cumlistRect = new Rect(pawnRectWidth, fontheight, wombRectWidth - pawnRectWidth, mainRect.yMax - wombRectHeight - fontheight); + Listing_Standard cumlist = new Listing_Standard + { + maxOneColumn = true, + ColumnWidth = wombRectWidth - pawnRectWidth + }; + cumlist.Begin(cumlistRect); + Listing_Standard cumlistsection = cumlist.BeginSection_NewTemp(mainRect.yMax - wombRectHeight - 2 * fontheight - 12f); + foreach(string s in comp.GetCumsInfo) + { + cumlistsection.Label(s); + } + cumlist.EndSection(cumlistsection); + cumlist.End(); + + Rect genitalRect = new Rect(24, pawnRectHeight + 2*fontheight, genitalRectWidth, genitalRectHeight + fontheight*2); + Rect genitalIconRect = new Rect(genitalRect.x,genitalRect.y + fontheight ,genitalRectWidth,genitalRectHeight); + Rect genitalVaginaLabelRect = new Rect(genitalRect.x,genitalRect.y,genitalRectWidth,fontheight); + Rect genitalAnusLabelRect = new Rect(genitalRect.x,genitalRect.y + fontheight +genitalRectHeight ,genitalRectWidth,fontheight); + + vagina = Utility.GetGenitalIcon(pawn); + anal = Utility.GetAnalIcon(pawn); + GUI.color = new Color(1.00f, 0.47f, 0.47f, 1); + GUI.Box(genitalRect, "", boxstyle); + GUI.color = pawn.story.SkinColor; + //Widgets.DrawTextureFitted(genitalIconRect, anal, 1.0f); + //Widgets.DrawTextureFitted(genitalIconRect, vagina, 1.0f); + GUI.DrawTexture(genitalIconRect, anal, ScaleMode.ScaleToFit); + GUI.DrawTexture(genitalIconRect, vagina, ScaleMode.ScaleToFit); + + GUI.color = Color.white; + GUI.Label(genitalVaginaLabelRect, Utility.GetVaginaLabel(pawn),fontstylecenter); + GUI.Label(genitalAnusLabelRect, Utility.GetAnusLabel(pawn),fontstylecenter); + + } + + + + + } +} diff --git a/source/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs b/source/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs new file mode 100644 index 0000000..5f5e314 --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RimWorld; +using Verse; + +namespace RJW_Menstruation +{ + public class FertPillOutcomDoer : IngestionOutcomeDoer + { + protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested) + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn); + if (comp.curStage.Equals(HediffComp_Menstruation.Stage.Follicular) || comp.curStage.Equals(HediffComp_Menstruation.Stage.Luteal)) comp.curStage = HediffComp_Menstruation.Stage.Ovulatory; + } + } + + +} diff --git a/source/RJW_Menstruation/RJW_Menstruation/GetGizmos.cs b/source/RJW_Menstruation/RJW_Menstruation/GetGizmos.cs new file mode 100644 index 0000000..cc884c7 --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/GetGizmos.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using HarmonyLib; +using Verse; +using RimWorld; +using rjw; +using UnityEngine; +using Verse.Sound; + +namespace RJW_Menstruation +{ + [HarmonyPatch(typeof(Pawn), "GetGizmos")] + public class Pawn_GetGizmos + { + public static void Postfix(ref IEnumerable __result, Pawn __instance) + { + List gizmoList = __result.ToList(); + bool isCreatureMine = __instance.Faction != null && (__instance.Faction.IsPlayer || __instance.IsPrisonerOfColony); + + if (!isCreatureMine) + { + return; + } + + if (Configurations.EnableWombIcon && __instance.gender == Gender.Female) + { + if (!__instance.IsAnimal()) + { + AddWombGizmos(__instance, ref gizmoList); + } + else if (Configurations.EnableAnimalCycle) + { + AddWombGizmos(__instance, ref gizmoList); + } + + } + + + + + __result = gizmoList; + } + + + private static void AddWombGizmos(Pawn __instance, ref List gizmoList) + { + gizmoList.Add(CreateGizmo_WombStatus(__instance)); + } + + private static Gizmo CreateGizmo_WombStatus(Pawn pawn) + { + HediffComp_Menstruation comp = pawn.health.hediffSet.GetFirstHediffOfDef(Genital_Helper.average_vagina).TryGetComp(); + Texture2D icon,icon_overay; + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + string description = ""; + if (Configurations.Debug) description += comp.curStage + ": " + comp.curStageHrs + "\n" + "fertcums: " + comp.TotalFertCum; + else description += comp.GetCurStageLabel + "\n"; + if (pawn.IsPregnant()) + { + icon = Utility.GetPregnancyIcon(comp,hediff); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + if (h.GestationProgress < 0.2f) icon_overay = Utility.GetCumIcon(comp); + else icon_overay = ContentFinder.Get(("Womb/Empty"), true); + } + else icon_overay = ContentFinder.Get(("Womb/Empty"), true); + } + else + { + icon = Utility.GetWombIcon(comp); + icon_overay = Utility.GetCumIcon(comp); + } + foreach (string s in comp.GetCumsInfo) description += s + "\n"; + + Color c = comp.GetCumMixtureColor; + + Gizmo gizmo = new Gizmo_Womb + { + defaultLabel = pawn.LabelShort, + defaultDesc = description, + icon = icon, + icon_overay = icon_overay, + cumcolor = c, + order = 100, + action = delegate + { + SoundDefOf.InfoCard_Open.PlayOneShotOnCamera(); + Find.WindowStack.Add(new Dialog_WombStatus(pawn, comp,icon)); + } + }; + return gizmo; + } + } + + + + + + +} diff --git a/source/RJW_Menstruation/RJW_Menstruation/Gizmo_Womb.cs b/source/RJW_Menstruation/RJW_Menstruation/Gizmo_Womb.cs new file mode 100644 index 0000000..e91f20f --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/Gizmo_Womb.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using UnityEngine; +using Verse.Sound; + +namespace RJW_Menstruation +{ + public class Gizmo_Womb : Command_Action + { + public Texture2D icon_overay; + public Color cumcolor; + + protected override void DrawIcon(Rect rect, Material buttonMat = null) + { + Texture2D badTex = icon; + Texture2D overay = icon_overay; + Color color = cumcolor; + + if (badTex == null) + { + badTex = BaseContent.BadTex; + } + if (overay == null) + { + overay = BaseContent.BadTex; + } + if (color == null) color = Color.white; + rect.position += new Vector2(iconOffset.x * rect.size.x, iconOffset.y * rect.size.y); + GUI.color = IconDrawColor; + Widgets.DrawTextureFitted(rect, badTex, this.iconDrawScale * 0.85f, this.iconProportions, this.iconTexCoords, this.iconAngle, buttonMat); + GUI.color = color; + Widgets.DrawTextureFitted(rect, overay, iconDrawScale * 0.85f, iconProportions, iconTexCoords, iconAngle, buttonMat); + GUI.color = Color.white; + } + + + + + } +} diff --git a/source/RJW_Menstruation/RJW_Menstruation/Harmony.cs b/source/RJW_Menstruation/RJW_Menstruation/Harmony.cs new file mode 100644 index 0000000..6e3171c --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/Harmony.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Reflection; +using HarmonyLib; +using Verse; +using RimWorld; +using rjw; + +namespace RJW_Menstruation +{ + [StaticConstructorOnStartup] + internal static class First + { + static First() + { + var har = new Harmony("LL"); + har.PatchAll(Assembly.GetExecutingAssembly()); + } + } + + + + +} diff --git a/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs b/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs new file mode 100644 index 0000000..4737ac4 --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs @@ -0,0 +1,780 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using HugsLib; +using rjw; +using UnityEngine; + +namespace RJW_Menstruation +{ + public class CompProperties_Menstruation : HediffCompProperties + { + public float maxCumCapacity; // ml + public float baseImplantationChanceFactor; + public float basefertilizationChanceFactor; + public float deviationFactor; + public int folicularIntervalDays = 14; //before ovulation including beginning of bleeding + public int lutealIntervalDays = 14; //after ovulation until bleeding + public int bleedingIntervalDays = 6; //must be less than folicularIntervalDays + public int recoveryIntervalDays = 10; //additional infertile days after gave birth + public int eggLifespanDays = 2; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday + public string wombTex = "Womb/Womb"; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday + + + public CompProperties_Menstruation() + { + + compClass = typeof(HediffComp_Menstruation); + } + } + + + public class HediffComp_Menstruation : HediffComp + { + const float minmakefilthvalue = 1.0f; + + public static readonly int tickInterval = 2500; // an hour + public CompProperties_Menstruation Props; + public Stage curStage = Stage.Follicular; + public int curStageHrs = 0; + + public enum Stage + { + Follicular, + Ovulatory, + Luteal, + Bleeding, + Fertilized, + Pregnant, + Recover + } + + private List cums; + private bool loaded = false; + private List eggs; + private int follicularIntervalhours = -1; + private int lutealIntervalhours = -1; + private int bleedingIntervalhours = -1; + private int recoveryIntervalhours = -1; + private Action actionref; + + public float TotalCum + { + get + { + float res = 0; + if (cums.NullOrEmpty()) return 0; + foreach (Cum cum in cums) + { + res += cum.volume; + } + return res; + } + } + public float TotalFertCum + { + get + { + float res = 0; + if (cums.NullOrEmpty()) return 0; + foreach (Cum cum in cums) + { + if (!cum.notcum) res += cum.fertvolume; + } + return res; + } + } + public float TotalCumPercent + { + get + { + float res = 0; + if (cums.NullOrEmpty()) return 0; + foreach (Cum cum in cums) + { + res += cum.volume; + } + return res/ Props.maxCumCapacity; + } + } + public float CumCapacity + { + get + { + float res = Props.maxCumCapacity; + if (curStage == Stage.Pregnant) res *= 0.2f; + return res; + } + } + public float CumInFactor + { + get + { + float res = 1.0f; + if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) res = 0.001f; + return res; + } + } + //make follicular interval into half and double egg lifespan + public float CycleFactor + { + get + { + if (xxx.has_quirk(parent.pawn, "Breeder")) return 0.5f; + + return 1.0f; + } + } + //effect on implant chance + public float ImplantFactor + { + get + { + float factor = 1.0f; + if (xxx.has_quirk(parent.pawn, "Breeder")) factor = 10.0f; + if (xxx.is_animal(parent.pawn)) factor *= RJWPregnancySettings.animal_impregnation_chance/100f; + else factor *= RJWPregnancySettings.humanlike_impregnation_chance/100f; + return parent.pawn.health.capacities.GetLevel(xxx.reproduction) * factor; + } + } + public IEnumerable GetCumsInfo + { + get + { + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (!cum.notcum) yield return String.Format(cum.pawn.Label + ": {0:0.##}ml", cum.volume); + else yield return String.Format(cum.notcumLabel + ": {0:0.##}ml", cum.volume); + } + else yield return Translations.Info_noCum; + } + } + public Color GetCumMixtureColor + { + get + { + Color mixedcolor = Color.white; + + if (!cums.NullOrEmpty()) + { + float mixedsofar = 0; + foreach (Cum cum in cums) + { + mixedcolor = Color.LerpUnclamped(mixedcolor, cum.color, cum.volume/(mixedsofar + cum.volume)); + mixedsofar += cum.volume; + } + } + return mixedcolor; + } + } + public string GetCurStageLabel + { + get + { + switch (curStage) + { + case Stage.Follicular: + return Translations.Stage_Follicular; + case Stage.Ovulatory: + return Translations.Stage_Ovulatory; + case Stage.Luteal: + return Translations.Stage_Luteal; + case Stage.Bleeding: + return Translations.Stage_Bleeding; + case Stage.Fertilized: + return Translations.Stage_Fertilized; + case Stage.Pregnant: + return Translations.Stage_Pregnant; + case Stage.Recover: + return Translations.Stage_Recover; + default: + return ""; + } + } + + } + public bool GetEggFertilizing + { + get + { + if (!eggs.NullOrEmpty()) + { + if (!cums.NullOrEmpty()) foreach(Cum cum in cums) + { + if (cum.fertvolume > 0) return true; + } + return false; + + } + else return false; + } + } + public bool GetFertilization + { + get + { + if (!eggs.NullOrEmpty()) foreach(Egg egg in eggs) + { + if (egg.fertilized) return true; + } + return false; + } + } + public bool GetEgg + { + get + { + return !eggs.NullOrEmpty(); + } + } + + + public override void CompExposeData() + { + base.CompExposeData(); + Scribe_Collections.Look(ref cums, saveDestroyedThings: true, label: "cums", lookMode: LookMode.Deep, ctorArgs: new object[0]); + Scribe_Collections.Look(ref eggs, saveDestroyedThings: true, label: "eggs", lookMode: LookMode.Deep, ctorArgs: new object[0]); + Scribe_Values.Look(ref curStage, "curStage", curStage, true); + Scribe_Values.Look(ref curStageHrs, "curStageHrs", curStageHrs, true); + Scribe_Values.Look(ref follicularIntervalhours, "follicularIntervalhours", follicularIntervalhours, true); + Scribe_Values.Look(ref lutealIntervalhours, "lutealIntervalhours", lutealIntervalhours, true); + Scribe_Values.Look(ref bleedingIntervalhours, "bleedingIntervalhours", bleedingIntervalhours, true); + Scribe_Values.Look(ref recoveryIntervalhours, "recoveryIntervalhours", recoveryIntervalhours, true); + + + } + + public override void CompPostTick(ref float severityAdjustment) + { + if (!loaded) + { + Props = (CompProperties_Menstruation)props; + if (follicularIntervalhours < 0) + { + follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24,Props.deviationFactor); + curStage = RandomStage(); + } + + if (lutealIntervalhours < 0) lutealIntervalhours = PeriodRandomizer(Props.lutealIntervalDays*24, Props.deviationFactor); + if (bleedingIntervalhours < 0) bleedingIntervalhours = PeriodRandomizer(Props.bleedingIntervalDays*24, Props.deviationFactor); + if (recoveryIntervalhours < 0) recoveryIntervalhours = PeriodRandomizer(Props.recoveryIntervalDays * 24, Props.deviationFactor); + if (cums == null) cums = new List(); + if (eggs == null) eggs = new List(); + if (parent.pawn.IsPregnant()) curStage = Stage.Pregnant; + if (Configurations.EnableAnimalCycle) + { + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false); + } + else if (!parent.pawn.IsAnimal()) HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false); + loaded = true; + } + } + + public override void CompPostPostRemoved() + { + HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(actionref); + ModLog.Message(parent.pawn.Label + "tick scheduler removed"); + base.CompPostPostRemoved(); + } + + + public Cum GetNotCum(string notcumlabel) + { + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.notcum && cum.notcumLabel.Equals(notcumlabel)) return cum; + } + return null; + } + + public Cum GetCum(Pawn pawn) + { + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (!cum.notcum && cum.pawn.Equals(pawn)) return cum; + } + return null; + } + + + + public void CumIn(Pawn pawn, float injectedvolume, float fertility = 1.0f, ThingDef filthdef = null) + { + float volume = injectedvolume * CumInFactor; + float tmp = TotalCum + volume; + if (tmp > Props.maxCumCapacity) + { + float cumoutrate = 1 - (Props.maxCumCapacity / tmp); + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.pawn.Equals(pawn)) + { + cum.volume += volume; + cum.fertvolume += volume; + cum.FilthDef = filthdef; + merged = true; + } + cum.volume *= 1 - cumoutrate; + cum.fertvolume *= 1 - cumoutrate; + } + if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate),fertility, filthdef)); + } + else + { + + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.pawn.Equals(pawn)) + { + cum.volume += volume; + cum.fertvolume += volume; + cum.FilthDef = filthdef; + merged = true; + } + } + if (!merged) cums.Add(new Cum(pawn, volume, fertility, filthdef)); + } + } + + public void CumIn(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthdef = null) + { + float tmp = TotalCum + volume; + if (tmp > Props.maxCumCapacity) + { + float cumoutrate = 1 - (Props.maxCumCapacity / tmp); + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.notcum && cum.pawn.Equals(pawn) && cum.notcumLabel.Equals(notcumlabel)) + { + cum.volume += volume; + cum.decayresist = decayresist; + cum.fertvolume = 0; + cum.FilthDef = filthdef; + merged = true; + } + cum.volume *= 1 - cumoutrate; + cum.fertvolume *= 1 - cumoutrate; + } + if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate), notcumlabel,decayresist, filthdef)); + } + else + { + + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.notcum && cum.pawn.Equals(pawn) && cum.notcumLabel.Equals(notcumlabel)) + { + cum.volume += volume; + cum.decayresist = decayresist; + cum.fertvolume = 0; + cum.FilthDef = filthdef; + merged = true; + } + } + if (!merged) cums.Add(new Cum(pawn, volume, notcumlabel,decayresist, filthdef)); + } + } + + + public void CumOut() + { + if (cums.NullOrEmpty()) return; + List removecums = new List(); + foreach(Cum cum in cums) + { + float vd = cum.volume; + cum.volume *= Math.Max(0,(1 - (Configurations.CumDecayRatio * (1 - cum.decayresist)))); + cum.fertvolume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist))) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist)))); + if (vd - cum.volume > minmakefilthvalue) MakeCumFilth(cum); + if (cum.fertvolume < 0.01f) cum.fertvolume = 0; + if (cum.volume < 0.01f) removecums.Add(cum); + } + foreach(Cum cum in removecums) + { + cums.Remove(cum); + } + removecums.Clear(); + } + + public float CumOut(Cum targetcum, float portion = 0.1f) + { + if (cums.NullOrEmpty()) return 0; + float outcum = 0; + List removecums = new List(); + foreach (Cum cum in cums) + { + float vd = cum.volume; + if (cum.Equals(targetcum)) outcum = cum.volume * (portion * (1 - cum.decayresist)); + cum.volume *= Math.Max(0, 1 - (portion * (1 - cum.decayresist))); + cum.fertvolume *= Math.Max(0, (1 - (portion * (1 - cum.decayresist))) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist)))); + if (vd-cum.volume > minmakefilthvalue) MakeCumFilth(cum); + if (cum.fertvolume < 0.01f) cum.fertvolume = 0; + if (cum.volume < 0.01f) removecums.Add(cum); + } + foreach (Cum cum in removecums) + { + cums.Remove(cum); + } + removecums.Clear(); + return outcum; + } + + //ignores cum.decayresist + public float CumOutForce(Cum targetcum, float portion = 0.1f) + { + if (cums.NullOrEmpty()) return 0; + float outcum = 0; + List removecums = new List(); + foreach (Cum cum in cums) + { + float vd = cum.volume; + if (cum.Equals(targetcum)) outcum = cum.volume * (portion); + cum.volume *= 1 - (portion); + cum.fertvolume *= (1 - (portion)) * (1 - (Configurations.CumFertilityDecayRatio)); + if (vd - cum.volume > minmakefilthvalue) MakeCumFilth(cum); + if (cum.fertvolume < 0.01f) cum.fertvolume = 0; + if (cum.volume < 0.1f) removecums.Add(cum); + } + foreach (Cum cum in removecums) + { + cums.Remove(cum); + } + removecums.Clear(); + return outcum; + } + + + public bool FertilizationCheck() + { + if (!eggs.NullOrEmpty()) + { + bool onefertilized = false; + foreach (Egg egg in eggs) + { + if (!egg.fertilized) egg.fertilizer = Fertilize(); + if (egg.fertilizer != null) { + egg.fertilized = true; + onefertilized = true; + } + } + return onefertilized; + } + else return false; + } + + private Pawn Fertilize() + { + if (cums.NullOrEmpty()) return null; + foreach (Cum cum in cums) + { + float rand = Rand.Range(0.0f, 1.0f); + if (!cum.notcum && rand < cum.fertvolume * cum.fertFactor * Configurations.FertilizeChance * Props.basefertilizationChanceFactor) + { + return cum.pawn; + } + } + return null; + } + + + //for now, only one egg can be implanted + private bool Implant() + { + if (!eggs.NullOrEmpty()) + { + List deadeggs = new List(); + bool pregnant = false; + foreach(Egg egg in eggs) + { + if (!egg.fertilized) continue; + else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * Props.baseImplantationChanceFactor * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer)) + { + PregnancyHelper.PregnancyDecider(parent.pawn, egg.fertilizer); + pregnant = true; + break; + } + else deadeggs.Add(egg); + } + + if (pregnant) + { + eggs.Clear(); + deadeggs.Clear(); + return true; + } + else if (!deadeggs.NullOrEmpty()) + { + foreach (Egg egg in deadeggs) + { + eggs.Remove(egg); + } + deadeggs.Clear(); + } + } + return false; + } + + private void BleedOut() + { + //FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label); + CumIn(parent.pawn, Rand.Range(0f, 20f), Translations.Menstrual_Blood,-4.0f,ThingDefOf.Filth_Blood); + GetNotCum(Translations.Menstrual_Blood).color = Colors.blood; + } + + private void MakeCumFilth(Cum cum) + { + FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort); + } + + + + private void EggDecay() + { + List deadeggs = new List(); + foreach (Egg egg in eggs) + { + egg.lifespanhrs--; + if (egg.lifespanhrs < 0) deadeggs.Add(egg); + } + + if (!deadeggs.NullOrEmpty()) + { + foreach (Egg egg in deadeggs) + { + eggs.Remove(egg); + } + deadeggs.Clear(); + } + } + + + private Action PeriodSimulator(Enum targetstage) + { + Action action = null; + switch (targetstage) + { + case Stage.Follicular: + action = delegate + { + if (curStageHrs >= (follicularIntervalhours - bleedingIntervalhours) * CycleFactor) + { + GoNextStage(Stage.Ovulatory); + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + case Stage.Ovulatory: + action = delegate + { + eggs.Add(new Egg(Props.eggLifespanDays * 24)); + lutealIntervalhours = PeriodRandomizer(lutealIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Luteal); + }; + break; + case Stage.Luteal: + action = delegate + { + if (!eggs.NullOrEmpty()) + { + if (FertilizationCheck()) + { + GoNextStage(Stage.Fertilized); + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + } + else if (curStageHrs <= lutealIntervalhours) + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + else + { + bleedingIntervalhours = PeriodRandomizer(bleedingIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Bleeding); + } + }; + break; + case Stage.Bleeding: + action = delegate + { + if (curStageHrs >= bleedingIntervalhours) + { + follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Follicular); + } + else + { + if (curStageHrs < bleedingIntervalhours / 6) for (int i = 0; i < Configurations.CycleAcceleration; i++) BleedOut(); + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + case Stage.Fertilized: + action = delegate + { + if (curStageHrs >= 24) + { + if (Implant()) + { + GoNextStage(Stage.Pregnant); + } + else + { + GoNextStageSetHour(Stage.Luteal, 96); + } + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + case Stage.Pregnant: + action = delegate + { + if (parent.pawn.IsPregnant()) StayCurrentStageConst(Stage.Pregnant); + else GoNextStage(Stage.Recover); + }; + break; + case Stage.Recover: + action = delegate + { + if (curStageHrs >= recoveryIntervalhours) + { + follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Follicular); + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + default: + curStage = Stage.Follicular; + curStageHrs = 0; + if (follicularIntervalhours < 0) follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24, Props.deviationFactor); + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Follicular), tickInterval, parent.pawn, false); + break; + } + action += () => + { + CumOut(); + if (!eggs.NullOrEmpty()) EggDecay(); + }; + + actionref = action; + return action; + + void GoNextStage(Stage nextstage, float factor = 1.0f) + { + curStageHrs = 0; + curStage = nextstage; + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false); + } + + void GoNextStageSetHour(Stage nextstage, int hour, float factor = 1.0f) + { + curStageHrs = hour; + curStage = nextstage; + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false); + } + + void StayCurrentStage(float factor = 1.0f) + { + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), (int)(tickInterval * factor), parent.pawn, false); + } + + void StayCurrentStageConst(Stage curstage, float factor = 1.0f) + { + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curstage), (int)(tickInterval * factor), parent.pawn, false); + } + + + } + + + private int PeriodRandomizer(int intervalhours, float deviation) + { + return intervalhours + (int)(intervalhours*Rand.Range(-deviation,deviation)); + } + + private float InterspeciesImplantFactor(Pawn fertilizer) + { + if (RJWPregnancySettings.complex_interspecies) return SexUtility.BodySimilarity(parent.pawn, fertilizer); + else return RJWPregnancySettings.interspecies_impregnation_modifier; + } + + private Stage RandomStage() + { + int rand = Rand.Range(0,2); + + switch (rand) + { + case 0: + curStageHrs = Rand.Range(0, (Props.folicularIntervalDays - Props.bleedingIntervalDays) * 24); + return Stage.Follicular; + case 1: + curStageHrs = Rand.Range(0, Props.eggLifespanDays * 24); + return Stage.Luteal; + case 2: + curStageHrs = Rand.Range(0, Props.bleedingIntervalDays * 24); + return Stage.Bleeding; + default: return Stage.Follicular; + } + + + } + + + + public class Egg : IExposable + { + public bool fertilized; + public int lifespanhrs; + public Pawn fertilizer; + + public Egg() + { + fertilized = false; + lifespanhrs = 96; + fertilizer = null; + } + + public Egg(int lifespanhrs) + { + fertilized = false; + this.lifespanhrs = lifespanhrs; + fertilizer = null; + } + + public void ExposeData() + { + Scribe_References.Look(ref fertilizer, "fertilizer", true); + Scribe_Values.Look(ref fertilized, "fertilized", fertilized, true); + Scribe_Values.Look(ref lifespanhrs, "lifespanhrs", lifespanhrs, true); + } + } + + + } +} diff --git a/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj b/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj new file mode 100644 index 0000000..22b1d26 --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj @@ -0,0 +1,350 @@ + + + + + Debug + AnyCPU + {EED2F3B9-8C20-4194-919E-8D151B29F70B} + Library + RJW_Menstruation + RJW_Menstruation + v4.7.2 + 512 + true + true + 게시\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + false + ..\..\..\Assemblies\ + DEBUG;TRACE + prompt + 4 + false + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + D:\잉어\Lib\Harmony.2.0.4.0\net472\0Harmony.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll + False + + + ..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.2\Assemblies\HugsLib.dll + False + + + ..\..\..\..\RJW\1.1\Assemblies\RJW.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\Unity.TextMeshPro.dll + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AccessibilityModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AndroidJNIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AnimationModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ARModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AssetBundleModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AudioModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClothModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterInputModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterRendererModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CrashReportingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DirectorModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DSPGraphModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.FileSystemHttpModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GameCenterModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GridModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.HotReloadModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ImageConversionModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputLegacyModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.JSONSerializeModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.LocalizationModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ParticleSystemModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PerformanceReportingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.Physics2DModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PhysicsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ProfilerModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ScreenCaptureModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SharedInternalsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteMaskModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteShapeModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.StreamingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SubstanceModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextCoreModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextRenderingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TilemapModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TLSModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UI.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIElementsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UmbraModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UNETModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityConnectModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VehiclesModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VFXModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VideoModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VRModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.WindModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.XRModule.dll + False + + + + + False + Microsoft .NET Framework 4.7.2%28x86 및 x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + \ No newline at end of file diff --git a/source/RJW_Menstruation/RJW_Menstruation/RJW_Patch.cs b/source/RJW_Menstruation/RJW_Menstruation/RJW_Patch.cs new file mode 100644 index 0000000..894f3ae --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/RJW_Patch.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using HarmonyLib; +using rjw; +using Verse; + + +namespace RJW_Menstruation +{ + + [HarmonyPatch(typeof(PregnancyHelper), "impregnate")] + public static class impregnate_Patch + { + public static bool Prefix(Pawn pawn, Pawn partner, xxx.rjwSextype sextype = xxx.rjwSextype.None) + { + if (sextype == xxx.rjwSextype.Vaginal) + { + var pawnpartBPR = Genital_Helper.get_genitalsBPR(pawn); + var pawnparts = Genital_Helper.get_PartsHediffList(pawn, pawnpartBPR); + var partnerpartBPR = Genital_Helper.get_genitalsBPR(partner); + var partnerparts = Genital_Helper.get_PartsHediffList(partner, partnerpartBPR); + + if (Genital_Helper.has_vagina(partner, partnerparts)) + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner); + if (comp != null) + { + if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && PregnancyHelper.CanImpregnate(pawn, partner, sextype)) + { + PregnancyHelper.Doimpregnate(pawn, partner); + return false; + } + else comp.CumIn(pawn, Utility.GetCumVolume(pawn), 0); + } + } + else if (Genital_Helper.has_vagina(pawn, pawnparts)) + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn); + if (comp != null) + { + if (Genital_Helper.has_penis_fertile(partner, partnerparts) && PregnancyHelper.CanImpregnate(partner, pawn, sextype)) + { + PregnancyHelper.Doimpregnate(partner, pawn); + return false; + } + else comp.CumIn(partner, Utility.GetCumVolume(partner), 0); + } + } + } + return true; + + + } + } + + [HarmonyPatch(typeof(PregnancyHelper), "Doimpregnate")] + public static class Doimpregnate_Patch + { + public static bool Prefix(Pawn pawn, Pawn partner) // partner has vagina + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner); + if (comp != null) + { + if (AndroidsCompatibility.IsAndroid(pawn) && !AndroidsCompatibility.AndroidPenisFertility(pawn)) + { + comp.CumIn(pawn, Utility.GetCumVolume(pawn),0); + return false; + } + else comp.CumIn(pawn, Utility.GetCumVolume(pawn), pawn.health.capacities.GetLevel(xxx.reproduction)); + return false; + } + ModLog.Message("used original rjw method: Comp missing"); + return true; + } + } + + + + + + + + + +} diff --git a/source/RJW_Menstruation/RJW_Menstruation/Translations.cs b/source/RJW_Menstruation/RJW_Menstruation/Translations.cs new file mode 100644 index 0000000..6e524ba --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/Translations.cs @@ -0,0 +1,60 @@ +using Verse; + +namespace RJW_Menstruation +{ + public static class Translations + { + public static readonly string Mod_Title = "Mod_Title".Translate(); + public static readonly string Info_noCum = "Info_noCum".Translate(); + public static readonly string Menstrual_Blood = "Menstrual_Blood".Translate(); + public static readonly string Stage_Follicular = "Stage_Follicular".Translate(); + public static readonly string Stage_Ovulatory = "Stage_Ovulatory".Translate(); + public static readonly string Stage_Luteal = "Stage_Luteal".Translate(); + public static readonly string Stage_Bleeding = "Stage_Bleeding".Translate(); + public static readonly string Stage_Fertilized = "Stage_Fertilized".Translate(); + public static readonly string Stage_Pregnant = "Stage_Pregnant".Translate(); + public static readonly string Stage_Recover = "Stage_Recover".Translate(); + + public static readonly string Dialog_WombInfo01 = "Dialog_WombInfo01".Translate(); + public static readonly string Dialog_WombInfo02 = "Dialog_WombInfo02".Translate(); + public static readonly string Dialog_WombInfo03 = "Dialog_WombInfo03".Translate(); + public static readonly string Dialog_WombInfo04 = "Dialog_WombInfo04".Translate(); + public static readonly string Dialog_WombInfo05 = "Dialog_WombInfo05".Translate(); + public static readonly string Dialog_WombInfo06 = "Dialog_WombInfo06".Translate(); + public static readonly string Dialog_WombInfo07 = "Dialog_WombInfo07".Translate(); + public static readonly string Dialog_WombInfo08 = "Dialog_WombInfo08".Translate(); + public static readonly string Dialog_WombInfo09 = "Dialog_WombInfo09".Translate(); + public static readonly string Dialog_WombInfo10 = "Dialog_WombInfo10".Translate(); + + + public static readonly string Option1_Label = "Option1_Label".Translate(); + public static readonly string Option1_Desc = "Option1_Desc".Translate(); + public static readonly string Option2_Label = "Option2_Label".Translate(); + public static readonly string Option2_Desc = "Option2_Desc".Translate(); + public static readonly string Option3_Label = "Option3_Label".Translate(); + public static readonly string Option3_Desc = "Option3_Desc".Translate(); + public static readonly string Option4_Label = "Option4_Label".Translate(); + public static readonly string Option4_Desc = "Option4_Desc".Translate(); + public static readonly string Option5_Label = "Option5_Label".Translate(); + public static readonly string Option5_Desc = "Option5_Desc".Translate(); + public static readonly string Option6_Label = "Option6_Label".Translate(); + public static readonly string Option6_Desc = "Option6_Desc".Translate(); + public static readonly string Option7_Label = "Option7_Label".Translate(); + public static readonly string Option7_Desc = "Option7_Desc".Translate(); + public static readonly string Option8_Label = "Option8_Label".Translate(); + public static readonly string Option8_Desc = "Option8_Desc".Translate(); + public static readonly string Option9_Label = "Option9_Label".Translate(); + public static readonly string Option9_Desc = "Option9_Desc".Translate(); + public static readonly string Option10_Label = "Option10_Label".Translate(); + public static readonly string Option10_Desc = "Option10_Desc".Translate(); + public static readonly string Option11_Label = "Option11_Label".Translate(); + public static readonly string Option11_Desc = "Option11_Desc".Translate(); + public static readonly string Option12_Label = "Option12_Label".Translate(); + public static readonly string Option12_Desc = "Option12_Desc".Translate(); + public static readonly string Option13_Label = "Option13_Label".Translate(); + public static readonly string Option13_Desc = "Option13_Desc".Translate(); + + + + } +} diff --git a/source/RJW_Menstruation/RJW_Menstruation/Utility.cs b/source/RJW_Menstruation/RJW_Menstruation/Utility.cs new file mode 100644 index 0000000..3723868 --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/Utility.cs @@ -0,0 +1,223 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using rjw; +using RimWorld; +using UnityEngine; + +namespace RJW_Menstruation +{ + public static class Colors + { + public static Color blood = new Color(0.78f, 0, 0); + } + + + public static class Utility + { + + public static float GetCumVolume(Pawn pawn) + { + CompHediffBodyPart part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("penis")).InRandomOrder().FirstOrDefault().TryGetComp(); + if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorf")).InRandomOrder().FirstOrDefault().TryGetComp(); + if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorm")).InRandomOrder().FirstOrDefault().TryGetComp(); + if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("tentacle")).InRandomOrder().FirstOrDefault().TryGetComp(); + + return part?.FluidAmmount * part.FluidModifier * Rand.Range(0.8f, 1.2f) ?? 0.0f; + } + + public static HediffComp_Menstruation GetMenstruationComp(Pawn pawn) + { + var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + HediffComp_Menstruation result; + if (hedifflist.NullOrEmpty()) return null; + else + { + foreach (Hediff h in hedifflist) + { + result = h.TryGetComp(); + if (result != null) return result; + } + } + return null; + } + + public static bool HasMenstruationComp(Pawn pawn) + { + var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + HediffComp_Menstruation result; + if (hedifflist.NullOrEmpty()) return false; + else + { + foreach (Hediff h in hedifflist) + { + result = h.TryGetComp(); + if (result != null) return true; + } + } + return false; + } + + + public static HediffComp_Menstruation.Stage GetCurStage(Pawn pawn) + { + return GetMenstruationComp(pawn)?.curStage ?? HediffComp_Menstruation.Stage.Bleeding; + } + + + public static float GetPregnancyProgress(Pawn pawn) + { + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + return h.GestationProgress; + } + return -1; + } + + public static Pawn GetFetus(Pawn pawn) + { + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + return h?.babies?.First() ?? null; + } + //else if (hediff is Hediff_HumanlikePregnancy) + //{ + // Hediff_HumanlikePregnancy h = (Hediff_HumanlikePregnancy)hediff; + // return h?.babies?.First() ?? null; + //} + //else if (hediff is Hediff_BestialPregnancy) + //{ + // Hediff_BestialPregnancy h = (Hediff_BestialPregnancy)hediff; + // return h?.babies?.First() ?? null; + //} + else if (hediff is Hediff_MechanoidPregnancy) + { + Hediff_MechanoidPregnancy h = (Hediff_MechanoidPregnancy)hediff; + return h?.babies?.First() ?? null; + } + + + return null; + } + + + + public static Texture2D GetPregnancyIcon(HediffComp_Menstruation comp, Hediff hediff) + { + string icon = ""; + if (hediff is Hediff_MechanoidPregnancy) + { + return ContentFinder.Get(("Womb/Mechanoid_Fluid"), true); + } + else if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + string fetustex = DefDatabase.GetNamedSilentFail(h.babies.First().def.defName)?.fetusTexPath ?? "Fetus/Fetus_Default"; + if (h.GestationProgress < 0.2f) icon = comp.Props.wombTex + "_Implanted"; + else if (h.GestationProgress < 0.3f) icon += "Fetus/Fetus_Early00"; + else if (h.GestationProgress < 0.4f) icon += fetustex + "00"; + else if (h.GestationProgress < 0.5f) icon += fetustex + "01"; + else if (h.GestationProgress < 0.6f) icon += fetustex + "02"; + else if (h.GestationProgress < 0.7f) icon += fetustex + "03"; + else if (h.GestationProgress < 0.8f) icon += fetustex + "04"; + else icon += fetustex + "05"; + } + else icon = "Fetus/Slime_Abomi02"; + return ContentFinder.Get((icon), true); + } + + public static Texture2D GetCumIcon(HediffComp_Menstruation comp) + { + string icon = "Womb/"; + float cumpercent = comp.TotalCumPercent; + if (cumpercent < 0.001f) icon += "Empty"; + else if (cumpercent < 0.01f) icon += "Cum_00"; + else if (cumpercent < 0.05f) icon += "Cum_01"; + else if (cumpercent < 0.11f) icon += "Cum_02"; + else if (cumpercent < 0.17f) icon += "Cum_03"; + else if (cumpercent < 0.23f) icon += "Cum_04"; + else if (cumpercent < 0.29f) icon += "Cum_05"; + else if (cumpercent < 0.35f) icon += "Cum_06"; + else if (cumpercent < 0.41f) icon += "Cum_07"; + else if (cumpercent < 0.47f) icon += "Cum_08"; + else if (cumpercent < 0.53f) icon += "Cum_09"; + else if (cumpercent < 0.59f) icon += "Cum_10"; + else if (cumpercent < 0.65f) icon += "Cum_11"; + else if (cumpercent < 0.71f) icon += "Cum_12"; + else if (cumpercent < 0.77f) icon += "Cum_13"; + else if (cumpercent < 0.83f) icon += "Cum_14"; + else if (cumpercent < 0.89f) icon += "Cum_15"; + else if (cumpercent < 0.95f) icon += "Cum_16"; + else icon += "Cum_17"; + Texture2D cumtex = ContentFinder.Get((icon), true); + return cumtex; + } + + public static Texture2D GetWombIcon(HediffComp_Menstruation comp) + { + string icon = comp.Props.wombTex; + HediffComp_Menstruation.Stage stage = comp.curStage; + if (stage == HediffComp_Menstruation.Stage.Bleeding) icon += "_Bleeding"; + + Texture2D wombtex = ContentFinder.Get((icon), true); + + return wombtex; + } + + public static Texture2D GetGenitalIcon(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + string icon = "Genitals/"; + if (hediff.Severity < 0.20f) icon += "Vagina00"; //micro + else if (hediff.Severity < 0.30f) icon += "Vagina01"; //tight + else if (hediff.Severity < 0.40f) icon += "Vagina02"; //tight + else if (hediff.Severity < 0.47f) icon += "Vagina03"; //average + else if (hediff.Severity < 0.53f) icon += "Vagina04"; //average + else if (hediff.Severity < 0.60f) icon += "Vagina05"; //average + else if (hediff.Severity < 0.70f) icon += "Vagina06"; //accomodating + else if (hediff.Severity < 0.80f) icon += "Vagina07"; //accomodating + else if (hediff.Severity < 0.87f) icon += "Vagina08"; //cavernous + else if (hediff.Severity < 0.94f) icon += "Vagina09"; //cavernous + else if (hediff.Severity < 1.01f) icon += "Vagina10"; //cavernous + else icon += "Vagina11"; //abyssal + + return ContentFinder.Get((icon), true); + } + + public static Texture2D GetAnalIcon(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus")); + string icon = "Genitals/"; + if (hediff.Severity < 0.20f) icon += "Anal00"; //micro + else if (hediff.Severity < 0.40f) icon += "Anal01"; //tight + else if (hediff.Severity < 0.60f) icon += "Anal02"; //average + else if (hediff.Severity < 0.80f) icon += "Anal03"; //accomodating + else if (hediff.Severity < 1.01f) icon += "Anal04"; //cavernous + else icon += "Anal05"; //abyssal + + return ContentFinder.Get((icon), true); + } + + public static string GetVaginaLabel(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + return hediff.LabelBase + "\n" + hediff.LabelInBrackets; + } + public static string GetAnusLabel(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus")); + return hediff.Label; + } + + + + + } +} diff --git a/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs b/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs new file mode 100644 index 0000000..e84a4da --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using rjw; + +namespace RJW_Menstruation +{ + public static class VariousDefOf + { + public static readonly DNADef defaultDNA = new DNADef + { + fetusTexPath = "Fetus/Fetus_Default", + cumColor = new ColorInt(255, 255, 255, 255), + cumTickness = 0 + }; + + public static readonly ThingDef CumFilth = DefDatabase.GetNamed("FilthCum"); + public static readonly HediffDef RJW_IUD = DefDatabase.GetNamed("RJW_IUD"); + + } +} diff --git a/source/RJW_Menstruation3/RJW_Menstruation.sln b/source/RJW_Menstruation3/RJW_Menstruation.sln new file mode 100644 index 0000000..5f8b9e6 --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30907.101 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RJW_Menstruation", "RJW_Menstruation\RJW_Menstruation.csproj", "{847C0F22-0689-42A0-A09E-FBE17A53BD08}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {847C0F22-0689-42A0-A09E-FBE17A53BD08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {847C0F22-0689-42A0-A09E-FBE17A53BD08}.Debug|Any CPU.Build.0 = Debug|Any CPU + {847C0F22-0689-42A0-A09E-FBE17A53BD08}.Release|Any CPU.ActiveCfg = Release|Any CPU + {847C0F22-0689-42A0-A09E-FBE17A53BD08}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7C747E50-BD18-4B79-AB42-D6788A4024E3} + EndGlobalSection +EndGlobal diff --git a/source/RJW_Menstruation3/RJW_Menstruation/App.config b/source/RJW_Menstruation3/RJW_Menstruation/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/source/RJW_Menstruation3/RJW_Menstruation/Configurations.cs b/source/RJW_Menstruation3/RJW_Menstruation/Configurations.cs new file mode 100644 index 0000000..c765e78 --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/Configurations.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; + +namespace RJW_Menstruation +{ + public class Configurations : ModSettings + { + public static readonly float ImplantationChanceDefault = 0.25f; + public static readonly int ImplantationChanceAdjustDefault = 25; + public static readonly float FertilizeChanceDefault = 0.05f; + public static readonly int FertilizeChanceAdjustDefault = 50; + public static readonly float CumDecayRatioDefault = 0.05f; + public static readonly int CumDecayRatioAdjustDefault = 50; + public static readonly float CumFertilityDecayRatioDefault = 0.2f; + public static readonly int CumFertilityDecayRatioAdjustDefault = 200; + public static readonly int CycleAccelerationDefault = 6; + + public static float ImplantationChance = ImplantationChanceDefault; + public static int ImplantationChanceAdjust = ImplantationChanceAdjustDefault; + public static float FertilizeChance = FertilizeChanceDefault; + public static int FertilizeChanceAdjust = FertilizeChanceAdjustDefault; + public static float CumDecayRatio = CumDecayRatioDefault; + public static int CumDecayRatioAdjust = CumDecayRatioAdjustDefault; + public static float CumFertilityDecayRatio = CumFertilityDecayRatioDefault; + public static int CumFertilityDecayRatioAdjust = CumFertilityDecayRatioAdjustDefault; + public static int CycleAcceleration = CycleAccelerationDefault; + public static bool EnableWombIcon = true; + public static bool EnableAnimalCycle = false; + public static bool Debug = false; + + public override void ExposeData() + { + Scribe_Values.Look(ref ImplantationChanceAdjust, "ImplantationChanceAdjust", ImplantationChanceAdjust, true); + Scribe_Values.Look(ref ImplantationChance, "ImplantationChance", ImplantationChance, true); + Scribe_Values.Look(ref FertilizeChanceAdjust, "FertilizeChanceAdjust", FertilizeChanceAdjust, true); + Scribe_Values.Look(ref FertilizeChance, "FertilizeChance", FertilizeChance, true); + Scribe_Values.Look(ref CumDecayRatioAdjust, "CumDecayRatioAdjust", CumDecayRatioAdjust, true); + Scribe_Values.Look(ref CumDecayRatio, "CumDecayRatio", CumDecayRatio, true); + Scribe_Values.Look(ref CumFertilityDecayRatioAdjust, "CumFertilityDecayRatioAdjust", CumFertilityDecayRatioAdjust, true); + Scribe_Values.Look(ref CumFertilityDecayRatio, "CumFertilityDecayRatio", CumFertilityDecayRatio, true); + Scribe_Values.Look(ref EnableWombIcon, "EnableWombIcon", EnableWombIcon, true); + Scribe_Values.Look(ref EnableAnimalCycle, "EnableAnimalCycle", EnableAnimalCycle, true); + base.ExposeData(); + } + + + } + + + public class RJW_Menstruation : Mod + { + + private readonly Configurations config; + public RJW_Menstruation(ModContentPack content) : base(content) + { + config = GetSettings(); + + } + + public override string SettingsCategory() + { + return Translations.Mod_Title; + } + + public override void DoSettingsWindowContents(Rect inRect) + { + Rect mainRect = inRect.ContractedBy(20f); + Listing_Standard listmain = new Listing_Standard(); + listmain.Begin(mainRect); + + listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc); + + listmain.CheckboxLabeled(Translations.Option2_Label, ref Configurations.EnableAnimalCycle, Translations.Option2_Desc); + + listmain.Label(Translations.Option3_Label + " " + Configurations.ImplantationChance*100 + "%", -1, Translations.Option3_Desc); + Configurations.ImplantationChanceAdjust = (int)listmain.Slider(Configurations.ImplantationChanceAdjust, 0, 1000); + Configurations.ImplantationChance = (float)Configurations.ImplantationChanceAdjust/100; + + listmain.Label(Translations.Option4_Label + " " + Configurations.FertilizeChance*100 + "%", -1, Translations.Option4_Desc); + Configurations.FertilizeChanceAdjust = (int)listmain.Slider(Configurations.FertilizeChanceAdjust, 0, 1000); + Configurations.FertilizeChance = (float)Configurations.FertilizeChanceAdjust/1000; + + listmain.Label(Translations.Option5_Label + " " + Configurations.CumDecayRatio*100 + "%", -1, Translations.Option5_Desc); + Configurations.CumDecayRatioAdjust = (int)listmain.Slider(Configurations.CumDecayRatioAdjust, 0, 1000); + Configurations.CumDecayRatio = (float)Configurations.CumDecayRatioAdjust/1000; + + listmain.Label(Translations.Option6_Label + " " + Configurations.CumFertilityDecayRatio*100 + "%", -1, Translations.Option6_Desc); + Configurations.CumFertilityDecayRatioAdjust = (int)listmain.Slider(Configurations.CumFertilityDecayRatioAdjust, 0, 1000); + Configurations.CumFertilityDecayRatio = (float)Configurations.CumFertilityDecayRatioAdjust/1000; + + listmain.Label(Translations.Option7_Label + " x" + Configurations.CycleAcceleration, -1, Translations.Option7_Desc); + Configurations.CycleAcceleration = (int)listmain.Slider(Configurations.CycleAcceleration,1,50); + + + listmain.CheckboxLabeled(Translations.Option8_Label, ref Configurations.Debug, Translations.Option8_Desc); + if (listmain.ButtonText("reset to default")) + { + Configurations.ImplantationChanceAdjust = Configurations.ImplantationChanceAdjustDefault; + Configurations.FertilizeChanceAdjust = Configurations.FertilizeChanceAdjustDefault; + Configurations.CumDecayRatioAdjust = Configurations.CumDecayRatioAdjustDefault; + Configurations.CumFertilityDecayRatioAdjust = Configurations.CumFertilityDecayRatioAdjustDefault; + Configurations.EnableWombIcon = true; + Configurations.EnableAnimalCycle = false; + Configurations.CycleAcceleration = Configurations.CycleAccelerationDefault; + } + + + listmain.End(); + + + } + + + } + + + + +} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/Cum.cs b/source/RJW_Menstruation3/RJW_Menstruation/Cum.cs new file mode 100644 index 0000000..3fbb33f --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/Cum.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using UnityEngine; +using rjw; + +namespace RJW_Menstruation +{ + public class Cum : IExposable + { + public Pawn pawn; + + //public bool failedFertilization = false; + //public bool dead = false; + public float volume; // ml + public float fertvolume; + public float fertFactor = 1.0f; + public bool notcum = false; // for other fluids + public string notcumLabel = ""; + private bool useCustomColor = false; + private float notcumthickness = 0; + public float decayresist + { + get + { + if (!notcum) return DNA.cumTickness; + else return notcumthickness; + } + set + { + notcumthickness = value; + } + } + private Color customColor; + public DNADef DNA + { + get + { + if (DNAcache == null) + { + DNAcache = DefDatabase.GetNamedSilentFail(pawn.def.defName); + if (DNAcache == null) + { + DNAcache = VariousDefOf.defaultDNA; + } + return DNAcache; + } + else return DNAcache; + } + } + private DNADef DNAcache = null; + public ThingDef FilthDef + { + get + { + if (filthDef == null) return VariousDefOf.CumFilth; + else return filthDef; + } + set + { + filthDef = value; + } + } + private ThingDef filthDef = null; + public Color color + { + get + { + if (!useCustomColor) return DNA.CumColor; + else return customColor; + } + + set + { + useCustomColor = true; + customColor = value; + } + } + + + public Cum() {} + + public Cum(Pawn pawn) + { + this.pawn = pawn; + volume = 1.0f; + fertvolume = 1.0f; + decayresist = 0; + } + + public Cum(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthDef = null) + { + this.pawn = pawn; + this.volume = volume; + this.fertvolume = volume; + this.notcum = true; + this.notcumLabel = notcumlabel; + this.notcumthickness = decayresist; + this.filthDef = filthDef; + } + + public Cum(Pawn pawn, float volume, float fertility, ThingDef filthDef = null) + { + this.pawn = pawn; + this.volume = volume; + if (fertility > 0) + { + this.fertvolume = volume; + this.fertFactor = fertility; + } + else this.fertvolume = 0; + this.filthDef = filthDef; + } + + + + public void ExposeData() + { + Scribe_References.Look(ref pawn, "pawn", true); + Scribe_Values.Look(ref volume, "volume", volume, true); + Scribe_Values.Look(ref fertvolume, "fertvolume", fertvolume, true); + Scribe_Values.Look(ref notcumthickness, "notcumthickness", notcumthickness, true); + Scribe_Values.Look(ref fertFactor, "fertFactor", fertFactor, true); + Scribe_Values.Look(ref notcum, "notcum", notcum, true); + Scribe_Values.Look(ref notcumLabel, "notcumLabel", notcumLabel, true); + Scribe_Values.Look(ref useCustomColor, "useCustomColor", useCustomColor, true); + Scribe_Values.Look(ref customColor, "customColor", customColor, true); + + } + } + + + + + + +} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/DNADef.cs b/source/RJW_Menstruation3/RJW_Menstruation/DNADef.cs new file mode 100644 index 0000000..5f19368 --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/DNADef.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using UnityEngine; + + +namespace RJW_Menstruation +{ + public class DNADef : Def + { + public bool IsNone => string.IsNullOrEmpty(defName); + public static readonly DNADef None = new DNADef(); + + public string fetusTexPath; + public ColorInt cumColor; + public Color CumColor => cumColor.ToColor; + public float cumTickness = 0f; + + } + + + +} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/Dialog_WombStatus.cs b/source/RJW_Menstruation3/RJW_Menstruation/Dialog_WombStatus.cs new file mode 100644 index 0000000..6ed4294 --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/Dialog_WombStatus.cs @@ -0,0 +1,204 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; +using RimWorld; +using rjw; + +namespace RJW_Menstruation +{ + public class Dialog_WombStatus : Window + { + private Pawn pawn; + private HediffComp_Menstruation comp; + private const float windowMargin = 20f; + private const float pawnRectWidth = 150f; + private const float pawnRectHeight = 150f; + private const float wombRectHeight = 270f; + private const float wombRectWidth = 300f; + private const float fontheight = 30; + private const float genitalRectWidth = 102; + private const float genitalRectHeight = 140; + + + private Texture2D womb; + private Texture2D cum; + private Texture2D vagina; + private Texture2D anal; + private Color cumcolor; + + public override Vector2 InitialSize + { + get + { + return new Vector2(300f + 2*windowMargin,800f); + } + } + + public Dialog_WombStatus(Pawn pawn, HediffComp_Menstruation comp, Texture2D icon) + { + this.pawn = pawn; + this.comp = comp; + womb = icon; + } + + public override void DoWindowContents(Rect inRect) + { + bool flag = false; + soundClose = SoundDefOf.InfoCard_Close; + //closeOnClickedOutside = true; + absorbInputAroundWindow = false; + forcePause = false; + preventCameraMotion = false; + draggable = true; + //resizeable = true; + + if (Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.Escape)) + { + flag = true; + Event.current.Use(); + } + + Rect windowRect = inRect.ContractedBy(windowMargin); + Rect mainRect = new Rect(windowRect.x, windowRect.y, windowRect.width, windowRect.height - 20f); + Rect closeRect = new Rect(windowRect.xMax, 0f, 20f, 20f); + MainContents(mainRect); + if (Widgets.CloseButtonFor(closeRect)) + { + Close(); + } + } + + private void MainContents(Rect mainRect) + { + GUIStyle fontstylecenter = new GUIStyle() { alignment = TextAnchor.MiddleCenter }; + GUIStyle fontstyleright = new GUIStyle() { alignment = TextAnchor.MiddleRight }; + GUIStyle fontstyleleft = new GUIStyle() { alignment = TextAnchor.MiddleLeft }; + GUIStyle boxstyle = new GUIStyle(GUI.skin.textArea); + GUIStyle buttonstyle = new GUIStyle(GUI.skin.button); + boxstyle.hover = boxstyle.normal; + boxstyle.onHover = boxstyle.normal; + boxstyle.onNormal = boxstyle.normal; + + buttonstyle.onHover = buttonstyle.onNormal; + buttonstyle.hover = buttonstyle.normal; + boxstyle.border.left = 4; boxstyle.border.right = 4; boxstyle.border.bottom = 4; boxstyle.border.top = 4; + + float preginfoheight = 0f; + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + if (pawn.IsPregnant()) + { + womb = Utility.GetPregnancyIcon(comp, hediff); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + if (h.GestationProgress < 0.2f) cum = Utility.GetCumIcon(comp); + else cum = ContentFinder.Get(("Womb/Empty"), true); + Pawn fetus = Utility.GetFetus(pawn); + preginfoheight = fontheight; + Rect preginfo = new Rect(0f, mainRect.yMax - wombRectHeight - 2, wombRectWidth, preginfoheight); + if (fetus != null) + { + fontstyleright.normal.textColor = Color.white; + buttonstyle.alignment = TextAnchor.MiddleLeft; + GUI.Box(preginfo, h.babies.Count + " " + fetus.def.label + " " + Translations.Dialog_WombInfo02, buttonstyle); + GUI.Label(preginfo, Translations.Dialog_WombInfo03 + ": " + h.father.LabelShort + " ", fontstyleright); + } + + } + else cum = ContentFinder.Get(("Womb/Empty"), true); + } + else + { + womb = Utility.GetWombIcon(comp); + cum = Utility.GetCumIcon(comp); + } + + + Rect pawnRect = new Rect(0, 0, pawnRectWidth, pawnRectHeight); + Widgets.DrawTextureFitted(pawnRect,PortraitsCache.Get(pawn, pawnRect.size),1.0f); + Rect pawnLabelRect = new Rect(0, pawnRectHeight, pawnRectWidth, fontheight-10); + Rect pawnLabel2Rect = new Rect(0, pawnRectHeight+fontheight-10, pawnRectWidth, fontheight-10); + fontstylecenter.normal.textColor = pawn.DrawColor; + GUI.Label(pawnLabelRect, pawn.Name.ToStringFull, fontstylecenter); + GUI.Label(pawnLabel2Rect, pawn.story.Title, fontstylecenter); + GUI.color = Color.white; + + + Rect wombInfoRect = new Rect(0f, mainRect.yMax - wombRectHeight - fontheight - 2, wombRectWidth, fontheight); + + buttonstyle.normal.textColor = Color.white; + //boxstyle.normal.background = Texture2D.whiteTexture; + buttonstyle.alignment = TextAnchor.MiddleLeft; + GUI.backgroundColor = new Color(0.24f, 0.29f, 0.35f, 1); + GUI.Box(wombInfoRect, Translations.Dialog_WombInfo01 + ": " + comp.GetCurStageLabel,buttonstyle); + GUI.color = Color.white; + + + fontstyleright.normal.textColor = Color.red; + if (comp.GetFertilization) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo05 + " ", fontstyleright); + else if (comp.GetEggFertilizing) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo06 + " ", fontstyleright); + else if (comp.GetEgg) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo07 + " ", fontstyleright); + + //Widgets.Label(wombInfoRect,Translations.Dialog_WombInfo01 + ": " + comp.GetCurStageLabel); + + + cumcolor = comp.GetCumMixtureColor; + Rect wombRect = new Rect(0f, mainRect.yMax - wombRectHeight + preginfoheight, wombRectWidth, wombRectHeight); + GUI.color = new Color(1.00f,0.47f,0.47f,1); + GUI.Box(wombRect,"",boxstyle); + //GUI.color = Color.white; + //Widgets.DrawTextureFitted(wombRect, womb,1.0f); + //GUI.color = cumcolor; + //Widgets.DrawTextureFitted(wombRect, cum,1.0f); + GUI.DrawTexture(wombRect, womb, ScaleMode.ScaleToFit, true, 0, Color.white, 0, 0); + GUI.DrawTexture(wombRect, cum, ScaleMode.ScaleToFit, true, 0, cumcolor,0,0); + GUI.color = Color.white; + + Rect cumlistTitle = new Rect(pawnRectWidth, 0, wombRectWidth - pawnRectWidth, fontheight); + GUI.Label(cumlistTitle,Translations.Dialog_WombInfo04); + + Rect cumlistRect = new Rect(pawnRectWidth, fontheight, wombRectWidth - pawnRectWidth, mainRect.yMax - wombRectHeight - fontheight); + Listing_Standard cumlist = new Listing_Standard + { + maxOneColumn = true, + ColumnWidth = wombRectWidth - pawnRectWidth + }; + cumlist.Begin(cumlistRect); + Listing_Standard cumlistsection = cumlist.BeginSection_NewTemp(mainRect.yMax - wombRectHeight - 2 * fontheight - 12f); + foreach(string s in comp.GetCumsInfo) + { + cumlistsection.Label(s); + } + cumlist.EndSection(cumlistsection); + cumlist.End(); + + Rect genitalRect = new Rect(24, pawnRectHeight + 2*fontheight, genitalRectWidth, genitalRectHeight + fontheight*2); + Rect genitalIconRect = new Rect(genitalRect.x,genitalRect.y + fontheight ,genitalRectWidth,genitalRectHeight); + Rect genitalVaginaLabelRect = new Rect(genitalRect.x,genitalRect.y,genitalRectWidth,fontheight); + Rect genitalAnusLabelRect = new Rect(genitalRect.x,genitalRect.y + fontheight +genitalRectHeight ,genitalRectWidth,fontheight); + + vagina = Utility.GetGenitalIcon(pawn); + anal = Utility.GetAnalIcon(pawn); + GUI.color = new Color(1.00f, 0.47f, 0.47f, 1); + GUI.Box(genitalRect, "", boxstyle); + GUI.color = pawn.story.SkinColor; + //Widgets.DrawTextureFitted(genitalIconRect, anal, 1.0f); + //Widgets.DrawTextureFitted(genitalIconRect, vagina, 1.0f); + GUI.DrawTexture(genitalIconRect, anal, ScaleMode.ScaleToFit); + GUI.DrawTexture(genitalIconRect, vagina, ScaleMode.ScaleToFit); + + GUI.color = Color.white; + GUI.Label(genitalVaginaLabelRect, Utility.GetVaginaLabel(pawn),fontstylecenter); + GUI.Label(genitalAnusLabelRect, Utility.GetAnusLabel(pawn),fontstylecenter); + + } + + + + + } +} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/DrugOutcomDoers.cs b/source/RJW_Menstruation3/RJW_Menstruation/DrugOutcomDoers.cs new file mode 100644 index 0000000..5f5e314 --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/DrugOutcomDoers.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RimWorld; +using Verse; + +namespace RJW_Menstruation +{ + public class FertPillOutcomDoer : IngestionOutcomeDoer + { + protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested) + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn); + if (comp.curStage.Equals(HediffComp_Menstruation.Stage.Follicular) || comp.curStage.Equals(HediffComp_Menstruation.Stage.Luteal)) comp.curStage = HediffComp_Menstruation.Stage.Ovulatory; + } + } + + +} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/GetGizmos.cs b/source/RJW_Menstruation3/RJW_Menstruation/GetGizmos.cs new file mode 100644 index 0000000..cc884c7 --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/GetGizmos.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using HarmonyLib; +using Verse; +using RimWorld; +using rjw; +using UnityEngine; +using Verse.Sound; + +namespace RJW_Menstruation +{ + [HarmonyPatch(typeof(Pawn), "GetGizmos")] + public class Pawn_GetGizmos + { + public static void Postfix(ref IEnumerable __result, Pawn __instance) + { + List gizmoList = __result.ToList(); + bool isCreatureMine = __instance.Faction != null && (__instance.Faction.IsPlayer || __instance.IsPrisonerOfColony); + + if (!isCreatureMine) + { + return; + } + + if (Configurations.EnableWombIcon && __instance.gender == Gender.Female) + { + if (!__instance.IsAnimal()) + { + AddWombGizmos(__instance, ref gizmoList); + } + else if (Configurations.EnableAnimalCycle) + { + AddWombGizmos(__instance, ref gizmoList); + } + + } + + + + + __result = gizmoList; + } + + + private static void AddWombGizmos(Pawn __instance, ref List gizmoList) + { + gizmoList.Add(CreateGizmo_WombStatus(__instance)); + } + + private static Gizmo CreateGizmo_WombStatus(Pawn pawn) + { + HediffComp_Menstruation comp = pawn.health.hediffSet.GetFirstHediffOfDef(Genital_Helper.average_vagina).TryGetComp(); + Texture2D icon,icon_overay; + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + string description = ""; + if (Configurations.Debug) description += comp.curStage + ": " + comp.curStageHrs + "\n" + "fertcums: " + comp.TotalFertCum; + else description += comp.GetCurStageLabel + "\n"; + if (pawn.IsPregnant()) + { + icon = Utility.GetPregnancyIcon(comp,hediff); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + if (h.GestationProgress < 0.2f) icon_overay = Utility.GetCumIcon(comp); + else icon_overay = ContentFinder.Get(("Womb/Empty"), true); + } + else icon_overay = ContentFinder.Get(("Womb/Empty"), true); + } + else + { + icon = Utility.GetWombIcon(comp); + icon_overay = Utility.GetCumIcon(comp); + } + foreach (string s in comp.GetCumsInfo) description += s + "\n"; + + Color c = comp.GetCumMixtureColor; + + Gizmo gizmo = new Gizmo_Womb + { + defaultLabel = pawn.LabelShort, + defaultDesc = description, + icon = icon, + icon_overay = icon_overay, + cumcolor = c, + order = 100, + action = delegate + { + SoundDefOf.InfoCard_Open.PlayOneShotOnCamera(); + Find.WindowStack.Add(new Dialog_WombStatus(pawn, comp,icon)); + } + }; + return gizmo; + } + } + + + + + + +} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/Gizmo_Womb.cs b/source/RJW_Menstruation3/RJW_Menstruation/Gizmo_Womb.cs new file mode 100644 index 0000000..e91f20f --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/Gizmo_Womb.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using UnityEngine; +using Verse.Sound; + +namespace RJW_Menstruation +{ + public class Gizmo_Womb : Command_Action + { + public Texture2D icon_overay; + public Color cumcolor; + + protected override void DrawIcon(Rect rect, Material buttonMat = null) + { + Texture2D badTex = icon; + Texture2D overay = icon_overay; + Color color = cumcolor; + + if (badTex == null) + { + badTex = BaseContent.BadTex; + } + if (overay == null) + { + overay = BaseContent.BadTex; + } + if (color == null) color = Color.white; + rect.position += new Vector2(iconOffset.x * rect.size.x, iconOffset.y * rect.size.y); + GUI.color = IconDrawColor; + Widgets.DrawTextureFitted(rect, badTex, this.iconDrawScale * 0.85f, this.iconProportions, this.iconTexCoords, this.iconAngle, buttonMat); + GUI.color = color; + Widgets.DrawTextureFitted(rect, overay, iconDrawScale * 0.85f, iconProportions, iconTexCoords, iconAngle, buttonMat); + GUI.color = Color.white; + } + + + + + } +} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/Harmony.cs b/source/RJW_Menstruation3/RJW_Menstruation/Harmony.cs new file mode 100644 index 0000000..6e3171c --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/Harmony.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Reflection; +using HarmonyLib; +using Verse; +using RimWorld; +using rjw; + +namespace RJW_Menstruation +{ + [StaticConstructorOnStartup] + internal static class First + { + static First() + { + var har = new Harmony("LL"); + har.PatchAll(Assembly.GetExecutingAssembly()); + } + } + + + + +} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/HediffComp_Menstruation.cs b/source/RJW_Menstruation3/RJW_Menstruation/HediffComp_Menstruation.cs new file mode 100644 index 0000000..4737ac4 --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/HediffComp_Menstruation.cs @@ -0,0 +1,780 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using HugsLib; +using rjw; +using UnityEngine; + +namespace RJW_Menstruation +{ + public class CompProperties_Menstruation : HediffCompProperties + { + public float maxCumCapacity; // ml + public float baseImplantationChanceFactor; + public float basefertilizationChanceFactor; + public float deviationFactor; + public int folicularIntervalDays = 14; //before ovulation including beginning of bleeding + public int lutealIntervalDays = 14; //after ovulation until bleeding + public int bleedingIntervalDays = 6; //must be less than folicularIntervalDays + public int recoveryIntervalDays = 10; //additional infertile days after gave birth + public int eggLifespanDays = 2; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday + public string wombTex = "Womb/Womb"; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday + + + public CompProperties_Menstruation() + { + + compClass = typeof(HediffComp_Menstruation); + } + } + + + public class HediffComp_Menstruation : HediffComp + { + const float minmakefilthvalue = 1.0f; + + public static readonly int tickInterval = 2500; // an hour + public CompProperties_Menstruation Props; + public Stage curStage = Stage.Follicular; + public int curStageHrs = 0; + + public enum Stage + { + Follicular, + Ovulatory, + Luteal, + Bleeding, + Fertilized, + Pregnant, + Recover + } + + private List cums; + private bool loaded = false; + private List eggs; + private int follicularIntervalhours = -1; + private int lutealIntervalhours = -1; + private int bleedingIntervalhours = -1; + private int recoveryIntervalhours = -1; + private Action actionref; + + public float TotalCum + { + get + { + float res = 0; + if (cums.NullOrEmpty()) return 0; + foreach (Cum cum in cums) + { + res += cum.volume; + } + return res; + } + } + public float TotalFertCum + { + get + { + float res = 0; + if (cums.NullOrEmpty()) return 0; + foreach (Cum cum in cums) + { + if (!cum.notcum) res += cum.fertvolume; + } + return res; + } + } + public float TotalCumPercent + { + get + { + float res = 0; + if (cums.NullOrEmpty()) return 0; + foreach (Cum cum in cums) + { + res += cum.volume; + } + return res/ Props.maxCumCapacity; + } + } + public float CumCapacity + { + get + { + float res = Props.maxCumCapacity; + if (curStage == Stage.Pregnant) res *= 0.2f; + return res; + } + } + public float CumInFactor + { + get + { + float res = 1.0f; + if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) res = 0.001f; + return res; + } + } + //make follicular interval into half and double egg lifespan + public float CycleFactor + { + get + { + if (xxx.has_quirk(parent.pawn, "Breeder")) return 0.5f; + + return 1.0f; + } + } + //effect on implant chance + public float ImplantFactor + { + get + { + float factor = 1.0f; + if (xxx.has_quirk(parent.pawn, "Breeder")) factor = 10.0f; + if (xxx.is_animal(parent.pawn)) factor *= RJWPregnancySettings.animal_impregnation_chance/100f; + else factor *= RJWPregnancySettings.humanlike_impregnation_chance/100f; + return parent.pawn.health.capacities.GetLevel(xxx.reproduction) * factor; + } + } + public IEnumerable GetCumsInfo + { + get + { + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (!cum.notcum) yield return String.Format(cum.pawn.Label + ": {0:0.##}ml", cum.volume); + else yield return String.Format(cum.notcumLabel + ": {0:0.##}ml", cum.volume); + } + else yield return Translations.Info_noCum; + } + } + public Color GetCumMixtureColor + { + get + { + Color mixedcolor = Color.white; + + if (!cums.NullOrEmpty()) + { + float mixedsofar = 0; + foreach (Cum cum in cums) + { + mixedcolor = Color.LerpUnclamped(mixedcolor, cum.color, cum.volume/(mixedsofar + cum.volume)); + mixedsofar += cum.volume; + } + } + return mixedcolor; + } + } + public string GetCurStageLabel + { + get + { + switch (curStage) + { + case Stage.Follicular: + return Translations.Stage_Follicular; + case Stage.Ovulatory: + return Translations.Stage_Ovulatory; + case Stage.Luteal: + return Translations.Stage_Luteal; + case Stage.Bleeding: + return Translations.Stage_Bleeding; + case Stage.Fertilized: + return Translations.Stage_Fertilized; + case Stage.Pregnant: + return Translations.Stage_Pregnant; + case Stage.Recover: + return Translations.Stage_Recover; + default: + return ""; + } + } + + } + public bool GetEggFertilizing + { + get + { + if (!eggs.NullOrEmpty()) + { + if (!cums.NullOrEmpty()) foreach(Cum cum in cums) + { + if (cum.fertvolume > 0) return true; + } + return false; + + } + else return false; + } + } + public bool GetFertilization + { + get + { + if (!eggs.NullOrEmpty()) foreach(Egg egg in eggs) + { + if (egg.fertilized) return true; + } + return false; + } + } + public bool GetEgg + { + get + { + return !eggs.NullOrEmpty(); + } + } + + + public override void CompExposeData() + { + base.CompExposeData(); + Scribe_Collections.Look(ref cums, saveDestroyedThings: true, label: "cums", lookMode: LookMode.Deep, ctorArgs: new object[0]); + Scribe_Collections.Look(ref eggs, saveDestroyedThings: true, label: "eggs", lookMode: LookMode.Deep, ctorArgs: new object[0]); + Scribe_Values.Look(ref curStage, "curStage", curStage, true); + Scribe_Values.Look(ref curStageHrs, "curStageHrs", curStageHrs, true); + Scribe_Values.Look(ref follicularIntervalhours, "follicularIntervalhours", follicularIntervalhours, true); + Scribe_Values.Look(ref lutealIntervalhours, "lutealIntervalhours", lutealIntervalhours, true); + Scribe_Values.Look(ref bleedingIntervalhours, "bleedingIntervalhours", bleedingIntervalhours, true); + Scribe_Values.Look(ref recoveryIntervalhours, "recoveryIntervalhours", recoveryIntervalhours, true); + + + } + + public override void CompPostTick(ref float severityAdjustment) + { + if (!loaded) + { + Props = (CompProperties_Menstruation)props; + if (follicularIntervalhours < 0) + { + follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24,Props.deviationFactor); + curStage = RandomStage(); + } + + if (lutealIntervalhours < 0) lutealIntervalhours = PeriodRandomizer(Props.lutealIntervalDays*24, Props.deviationFactor); + if (bleedingIntervalhours < 0) bleedingIntervalhours = PeriodRandomizer(Props.bleedingIntervalDays*24, Props.deviationFactor); + if (recoveryIntervalhours < 0) recoveryIntervalhours = PeriodRandomizer(Props.recoveryIntervalDays * 24, Props.deviationFactor); + if (cums == null) cums = new List(); + if (eggs == null) eggs = new List(); + if (parent.pawn.IsPregnant()) curStage = Stage.Pregnant; + if (Configurations.EnableAnimalCycle) + { + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false); + } + else if (!parent.pawn.IsAnimal()) HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false); + loaded = true; + } + } + + public override void CompPostPostRemoved() + { + HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(actionref); + ModLog.Message(parent.pawn.Label + "tick scheduler removed"); + base.CompPostPostRemoved(); + } + + + public Cum GetNotCum(string notcumlabel) + { + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.notcum && cum.notcumLabel.Equals(notcumlabel)) return cum; + } + return null; + } + + public Cum GetCum(Pawn pawn) + { + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (!cum.notcum && cum.pawn.Equals(pawn)) return cum; + } + return null; + } + + + + public void CumIn(Pawn pawn, float injectedvolume, float fertility = 1.0f, ThingDef filthdef = null) + { + float volume = injectedvolume * CumInFactor; + float tmp = TotalCum + volume; + if (tmp > Props.maxCumCapacity) + { + float cumoutrate = 1 - (Props.maxCumCapacity / tmp); + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.pawn.Equals(pawn)) + { + cum.volume += volume; + cum.fertvolume += volume; + cum.FilthDef = filthdef; + merged = true; + } + cum.volume *= 1 - cumoutrate; + cum.fertvolume *= 1 - cumoutrate; + } + if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate),fertility, filthdef)); + } + else + { + + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.pawn.Equals(pawn)) + { + cum.volume += volume; + cum.fertvolume += volume; + cum.FilthDef = filthdef; + merged = true; + } + } + if (!merged) cums.Add(new Cum(pawn, volume, fertility, filthdef)); + } + } + + public void CumIn(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthdef = null) + { + float tmp = TotalCum + volume; + if (tmp > Props.maxCumCapacity) + { + float cumoutrate = 1 - (Props.maxCumCapacity / tmp); + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.notcum && cum.pawn.Equals(pawn) && cum.notcumLabel.Equals(notcumlabel)) + { + cum.volume += volume; + cum.decayresist = decayresist; + cum.fertvolume = 0; + cum.FilthDef = filthdef; + merged = true; + } + cum.volume *= 1 - cumoutrate; + cum.fertvolume *= 1 - cumoutrate; + } + if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate), notcumlabel,decayresist, filthdef)); + } + else + { + + bool merged = false; + if (!cums.NullOrEmpty()) foreach (Cum cum in cums) + { + if (cum.notcum && cum.pawn.Equals(pawn) && cum.notcumLabel.Equals(notcumlabel)) + { + cum.volume += volume; + cum.decayresist = decayresist; + cum.fertvolume = 0; + cum.FilthDef = filthdef; + merged = true; + } + } + if (!merged) cums.Add(new Cum(pawn, volume, notcumlabel,decayresist, filthdef)); + } + } + + + public void CumOut() + { + if (cums.NullOrEmpty()) return; + List removecums = new List(); + foreach(Cum cum in cums) + { + float vd = cum.volume; + cum.volume *= Math.Max(0,(1 - (Configurations.CumDecayRatio * (1 - cum.decayresist)))); + cum.fertvolume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist))) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist)))); + if (vd - cum.volume > minmakefilthvalue) MakeCumFilth(cum); + if (cum.fertvolume < 0.01f) cum.fertvolume = 0; + if (cum.volume < 0.01f) removecums.Add(cum); + } + foreach(Cum cum in removecums) + { + cums.Remove(cum); + } + removecums.Clear(); + } + + public float CumOut(Cum targetcum, float portion = 0.1f) + { + if (cums.NullOrEmpty()) return 0; + float outcum = 0; + List removecums = new List(); + foreach (Cum cum in cums) + { + float vd = cum.volume; + if (cum.Equals(targetcum)) outcum = cum.volume * (portion * (1 - cum.decayresist)); + cum.volume *= Math.Max(0, 1 - (portion * (1 - cum.decayresist))); + cum.fertvolume *= Math.Max(0, (1 - (portion * (1 - cum.decayresist))) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist)))); + if (vd-cum.volume > minmakefilthvalue) MakeCumFilth(cum); + if (cum.fertvolume < 0.01f) cum.fertvolume = 0; + if (cum.volume < 0.01f) removecums.Add(cum); + } + foreach (Cum cum in removecums) + { + cums.Remove(cum); + } + removecums.Clear(); + return outcum; + } + + //ignores cum.decayresist + public float CumOutForce(Cum targetcum, float portion = 0.1f) + { + if (cums.NullOrEmpty()) return 0; + float outcum = 0; + List removecums = new List(); + foreach (Cum cum in cums) + { + float vd = cum.volume; + if (cum.Equals(targetcum)) outcum = cum.volume * (portion); + cum.volume *= 1 - (portion); + cum.fertvolume *= (1 - (portion)) * (1 - (Configurations.CumFertilityDecayRatio)); + if (vd - cum.volume > minmakefilthvalue) MakeCumFilth(cum); + if (cum.fertvolume < 0.01f) cum.fertvolume = 0; + if (cum.volume < 0.1f) removecums.Add(cum); + } + foreach (Cum cum in removecums) + { + cums.Remove(cum); + } + removecums.Clear(); + return outcum; + } + + + public bool FertilizationCheck() + { + if (!eggs.NullOrEmpty()) + { + bool onefertilized = false; + foreach (Egg egg in eggs) + { + if (!egg.fertilized) egg.fertilizer = Fertilize(); + if (egg.fertilizer != null) { + egg.fertilized = true; + onefertilized = true; + } + } + return onefertilized; + } + else return false; + } + + private Pawn Fertilize() + { + if (cums.NullOrEmpty()) return null; + foreach (Cum cum in cums) + { + float rand = Rand.Range(0.0f, 1.0f); + if (!cum.notcum && rand < cum.fertvolume * cum.fertFactor * Configurations.FertilizeChance * Props.basefertilizationChanceFactor) + { + return cum.pawn; + } + } + return null; + } + + + //for now, only one egg can be implanted + private bool Implant() + { + if (!eggs.NullOrEmpty()) + { + List deadeggs = new List(); + bool pregnant = false; + foreach(Egg egg in eggs) + { + if (!egg.fertilized) continue; + else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * Props.baseImplantationChanceFactor * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer)) + { + PregnancyHelper.PregnancyDecider(parent.pawn, egg.fertilizer); + pregnant = true; + break; + } + else deadeggs.Add(egg); + } + + if (pregnant) + { + eggs.Clear(); + deadeggs.Clear(); + return true; + } + else if (!deadeggs.NullOrEmpty()) + { + foreach (Egg egg in deadeggs) + { + eggs.Remove(egg); + } + deadeggs.Clear(); + } + } + return false; + } + + private void BleedOut() + { + //FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label); + CumIn(parent.pawn, Rand.Range(0f, 20f), Translations.Menstrual_Blood,-4.0f,ThingDefOf.Filth_Blood); + GetNotCum(Translations.Menstrual_Blood).color = Colors.blood; + } + + private void MakeCumFilth(Cum cum) + { + FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort); + } + + + + private void EggDecay() + { + List deadeggs = new List(); + foreach (Egg egg in eggs) + { + egg.lifespanhrs--; + if (egg.lifespanhrs < 0) deadeggs.Add(egg); + } + + if (!deadeggs.NullOrEmpty()) + { + foreach (Egg egg in deadeggs) + { + eggs.Remove(egg); + } + deadeggs.Clear(); + } + } + + + private Action PeriodSimulator(Enum targetstage) + { + Action action = null; + switch (targetstage) + { + case Stage.Follicular: + action = delegate + { + if (curStageHrs >= (follicularIntervalhours - bleedingIntervalhours) * CycleFactor) + { + GoNextStage(Stage.Ovulatory); + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + case Stage.Ovulatory: + action = delegate + { + eggs.Add(new Egg(Props.eggLifespanDays * 24)); + lutealIntervalhours = PeriodRandomizer(lutealIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Luteal); + }; + break; + case Stage.Luteal: + action = delegate + { + if (!eggs.NullOrEmpty()) + { + if (FertilizationCheck()) + { + GoNextStage(Stage.Fertilized); + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + } + else if (curStageHrs <= lutealIntervalhours) + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + else + { + bleedingIntervalhours = PeriodRandomizer(bleedingIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Bleeding); + } + }; + break; + case Stage.Bleeding: + action = delegate + { + if (curStageHrs >= bleedingIntervalhours) + { + follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Follicular); + } + else + { + if (curStageHrs < bleedingIntervalhours / 6) for (int i = 0; i < Configurations.CycleAcceleration; i++) BleedOut(); + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + case Stage.Fertilized: + action = delegate + { + if (curStageHrs >= 24) + { + if (Implant()) + { + GoNextStage(Stage.Pregnant); + } + else + { + GoNextStageSetHour(Stage.Luteal, 96); + } + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + case Stage.Pregnant: + action = delegate + { + if (parent.pawn.IsPregnant()) StayCurrentStageConst(Stage.Pregnant); + else GoNextStage(Stage.Recover); + }; + break; + case Stage.Recover: + action = delegate + { + if (curStageHrs >= recoveryIntervalhours) + { + follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor); + GoNextStage(Stage.Follicular); + } + else + { + curStageHrs+=Configurations.CycleAcceleration; + StayCurrentStage(); + } + }; + break; + default: + curStage = Stage.Follicular; + curStageHrs = 0; + if (follicularIntervalhours < 0) follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24, Props.deviationFactor); + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Follicular), tickInterval, parent.pawn, false); + break; + } + action += () => + { + CumOut(); + if (!eggs.NullOrEmpty()) EggDecay(); + }; + + actionref = action; + return action; + + void GoNextStage(Stage nextstage, float factor = 1.0f) + { + curStageHrs = 0; + curStage = nextstage; + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false); + } + + void GoNextStageSetHour(Stage nextstage, int hour, float factor = 1.0f) + { + curStageHrs = hour; + curStage = nextstage; + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false); + } + + void StayCurrentStage(float factor = 1.0f) + { + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), (int)(tickInterval * factor), parent.pawn, false); + } + + void StayCurrentStageConst(Stage curstage, float factor = 1.0f) + { + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curstage), (int)(tickInterval * factor), parent.pawn, false); + } + + + } + + + private int PeriodRandomizer(int intervalhours, float deviation) + { + return intervalhours + (int)(intervalhours*Rand.Range(-deviation,deviation)); + } + + private float InterspeciesImplantFactor(Pawn fertilizer) + { + if (RJWPregnancySettings.complex_interspecies) return SexUtility.BodySimilarity(parent.pawn, fertilizer); + else return RJWPregnancySettings.interspecies_impregnation_modifier; + } + + private Stage RandomStage() + { + int rand = Rand.Range(0,2); + + switch (rand) + { + case 0: + curStageHrs = Rand.Range(0, (Props.folicularIntervalDays - Props.bleedingIntervalDays) * 24); + return Stage.Follicular; + case 1: + curStageHrs = Rand.Range(0, Props.eggLifespanDays * 24); + return Stage.Luteal; + case 2: + curStageHrs = Rand.Range(0, Props.bleedingIntervalDays * 24); + return Stage.Bleeding; + default: return Stage.Follicular; + } + + + } + + + + public class Egg : IExposable + { + public bool fertilized; + public int lifespanhrs; + public Pawn fertilizer; + + public Egg() + { + fertilized = false; + lifespanhrs = 96; + fertilizer = null; + } + + public Egg(int lifespanhrs) + { + fertilized = false; + this.lifespanhrs = lifespanhrs; + fertilizer = null; + } + + public void ExposeData() + { + Scribe_References.Look(ref fertilizer, "fertilizer", true); + Scribe_Values.Look(ref fertilized, "fertilized", fertilized, true); + Scribe_Values.Look(ref lifespanhrs, "lifespanhrs", lifespanhrs, true); + } + } + + + } +} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/RJW_Menstruation.csproj b/source/RJW_Menstruation3/RJW_Menstruation/RJW_Menstruation.csproj new file mode 100644 index 0000000..22b1d26 --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/RJW_Menstruation.csproj @@ -0,0 +1,350 @@ + + + + + Debug + AnyCPU + {EED2F3B9-8C20-4194-919E-8D151B29F70B} + Library + RJW_Menstruation + RJW_Menstruation + v4.7.2 + 512 + true + true + 게시\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + false + ..\..\..\Assemblies\ + DEBUG;TRACE + prompt + 4 + false + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + D:\잉어\Lib\Harmony.2.0.4.0\net472\0Harmony.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll + False + + + ..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.2\Assemblies\HugsLib.dll + False + + + ..\..\..\..\RJW\1.1\Assemblies\RJW.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\Unity.TextMeshPro.dll + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AccessibilityModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AndroidJNIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AnimationModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ARModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AssetBundleModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AudioModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClothModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterInputModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterRendererModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CrashReportingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DirectorModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DSPGraphModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.FileSystemHttpModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GameCenterModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GridModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.HotReloadModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ImageConversionModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputLegacyModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.JSONSerializeModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.LocalizationModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ParticleSystemModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PerformanceReportingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.Physics2DModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PhysicsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ProfilerModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ScreenCaptureModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SharedInternalsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteMaskModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteShapeModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.StreamingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SubstanceModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextCoreModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextRenderingModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TilemapModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TLSModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UI.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIElementsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UmbraModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UNETModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityConnectModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VehiclesModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VFXModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VideoModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VRModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.WindModule.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.XRModule.dll + False + + + + + False + Microsoft .NET Framework 4.7.2%28x86 및 x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + \ No newline at end of file diff --git a/source/RJW_Menstruation3/RJW_Menstruation/RJW_Patch.cs b/source/RJW_Menstruation3/RJW_Menstruation/RJW_Patch.cs new file mode 100644 index 0000000..894f3ae --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/RJW_Patch.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using HarmonyLib; +using rjw; +using Verse; + + +namespace RJW_Menstruation +{ + + [HarmonyPatch(typeof(PregnancyHelper), "impregnate")] + public static class impregnate_Patch + { + public static bool Prefix(Pawn pawn, Pawn partner, xxx.rjwSextype sextype = xxx.rjwSextype.None) + { + if (sextype == xxx.rjwSextype.Vaginal) + { + var pawnpartBPR = Genital_Helper.get_genitalsBPR(pawn); + var pawnparts = Genital_Helper.get_PartsHediffList(pawn, pawnpartBPR); + var partnerpartBPR = Genital_Helper.get_genitalsBPR(partner); + var partnerparts = Genital_Helper.get_PartsHediffList(partner, partnerpartBPR); + + if (Genital_Helper.has_vagina(partner, partnerparts)) + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner); + if (comp != null) + { + if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && PregnancyHelper.CanImpregnate(pawn, partner, sextype)) + { + PregnancyHelper.Doimpregnate(pawn, partner); + return false; + } + else comp.CumIn(pawn, Utility.GetCumVolume(pawn), 0); + } + } + else if (Genital_Helper.has_vagina(pawn, pawnparts)) + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn); + if (comp != null) + { + if (Genital_Helper.has_penis_fertile(partner, partnerparts) && PregnancyHelper.CanImpregnate(partner, pawn, sextype)) + { + PregnancyHelper.Doimpregnate(partner, pawn); + return false; + } + else comp.CumIn(partner, Utility.GetCumVolume(partner), 0); + } + } + } + return true; + + + } + } + + [HarmonyPatch(typeof(PregnancyHelper), "Doimpregnate")] + public static class Doimpregnate_Patch + { + public static bool Prefix(Pawn pawn, Pawn partner) // partner has vagina + { + HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner); + if (comp != null) + { + if (AndroidsCompatibility.IsAndroid(pawn) && !AndroidsCompatibility.AndroidPenisFertility(pawn)) + { + comp.CumIn(pawn, Utility.GetCumVolume(pawn),0); + return false; + } + else comp.CumIn(pawn, Utility.GetCumVolume(pawn), pawn.health.capacities.GetLevel(xxx.reproduction)); + return false; + } + ModLog.Message("used original rjw method: Comp missing"); + return true; + } + } + + + + + + + + + +} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/Translations.cs b/source/RJW_Menstruation3/RJW_Menstruation/Translations.cs new file mode 100644 index 0000000..6e524ba --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/Translations.cs @@ -0,0 +1,60 @@ +using Verse; + +namespace RJW_Menstruation +{ + public static class Translations + { + public static readonly string Mod_Title = "Mod_Title".Translate(); + public static readonly string Info_noCum = "Info_noCum".Translate(); + public static readonly string Menstrual_Blood = "Menstrual_Blood".Translate(); + public static readonly string Stage_Follicular = "Stage_Follicular".Translate(); + public static readonly string Stage_Ovulatory = "Stage_Ovulatory".Translate(); + public static readonly string Stage_Luteal = "Stage_Luteal".Translate(); + public static readonly string Stage_Bleeding = "Stage_Bleeding".Translate(); + public static readonly string Stage_Fertilized = "Stage_Fertilized".Translate(); + public static readonly string Stage_Pregnant = "Stage_Pregnant".Translate(); + public static readonly string Stage_Recover = "Stage_Recover".Translate(); + + public static readonly string Dialog_WombInfo01 = "Dialog_WombInfo01".Translate(); + public static readonly string Dialog_WombInfo02 = "Dialog_WombInfo02".Translate(); + public static readonly string Dialog_WombInfo03 = "Dialog_WombInfo03".Translate(); + public static readonly string Dialog_WombInfo04 = "Dialog_WombInfo04".Translate(); + public static readonly string Dialog_WombInfo05 = "Dialog_WombInfo05".Translate(); + public static readonly string Dialog_WombInfo06 = "Dialog_WombInfo06".Translate(); + public static readonly string Dialog_WombInfo07 = "Dialog_WombInfo07".Translate(); + public static readonly string Dialog_WombInfo08 = "Dialog_WombInfo08".Translate(); + public static readonly string Dialog_WombInfo09 = "Dialog_WombInfo09".Translate(); + public static readonly string Dialog_WombInfo10 = "Dialog_WombInfo10".Translate(); + + + public static readonly string Option1_Label = "Option1_Label".Translate(); + public static readonly string Option1_Desc = "Option1_Desc".Translate(); + public static readonly string Option2_Label = "Option2_Label".Translate(); + public static readonly string Option2_Desc = "Option2_Desc".Translate(); + public static readonly string Option3_Label = "Option3_Label".Translate(); + public static readonly string Option3_Desc = "Option3_Desc".Translate(); + public static readonly string Option4_Label = "Option4_Label".Translate(); + public static readonly string Option4_Desc = "Option4_Desc".Translate(); + public static readonly string Option5_Label = "Option5_Label".Translate(); + public static readonly string Option5_Desc = "Option5_Desc".Translate(); + public static readonly string Option6_Label = "Option6_Label".Translate(); + public static readonly string Option6_Desc = "Option6_Desc".Translate(); + public static readonly string Option7_Label = "Option7_Label".Translate(); + public static readonly string Option7_Desc = "Option7_Desc".Translate(); + public static readonly string Option8_Label = "Option8_Label".Translate(); + public static readonly string Option8_Desc = "Option8_Desc".Translate(); + public static readonly string Option9_Label = "Option9_Label".Translate(); + public static readonly string Option9_Desc = "Option9_Desc".Translate(); + public static readonly string Option10_Label = "Option10_Label".Translate(); + public static readonly string Option10_Desc = "Option10_Desc".Translate(); + public static readonly string Option11_Label = "Option11_Label".Translate(); + public static readonly string Option11_Desc = "Option11_Desc".Translate(); + public static readonly string Option12_Label = "Option12_Label".Translate(); + public static readonly string Option12_Desc = "Option12_Desc".Translate(); + public static readonly string Option13_Label = "Option13_Label".Translate(); + public static readonly string Option13_Desc = "Option13_Desc".Translate(); + + + + } +} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/Utility.cs b/source/RJW_Menstruation3/RJW_Menstruation/Utility.cs new file mode 100644 index 0000000..3723868 --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/Utility.cs @@ -0,0 +1,223 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using rjw; +using RimWorld; +using UnityEngine; + +namespace RJW_Menstruation +{ + public static class Colors + { + public static Color blood = new Color(0.78f, 0, 0); + } + + + public static class Utility + { + + public static float GetCumVolume(Pawn pawn) + { + CompHediffBodyPart part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("penis")).InRandomOrder().FirstOrDefault().TryGetComp(); + if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorf")).InRandomOrder().FirstOrDefault().TryGetComp(); + if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorm")).InRandomOrder().FirstOrDefault().TryGetComp(); + if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("tentacle")).InRandomOrder().FirstOrDefault().TryGetComp(); + + return part?.FluidAmmount * part.FluidModifier * Rand.Range(0.8f, 1.2f) ?? 0.0f; + } + + public static HediffComp_Menstruation GetMenstruationComp(Pawn pawn) + { + var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + HediffComp_Menstruation result; + if (hedifflist.NullOrEmpty()) return null; + else + { + foreach (Hediff h in hedifflist) + { + result = h.TryGetComp(); + if (result != null) return result; + } + } + return null; + } + + public static bool HasMenstruationComp(Pawn pawn) + { + var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + HediffComp_Menstruation result; + if (hedifflist.NullOrEmpty()) return false; + else + { + foreach (Hediff h in hedifflist) + { + result = h.TryGetComp(); + if (result != null) return true; + } + } + return false; + } + + + public static HediffComp_Menstruation.Stage GetCurStage(Pawn pawn) + { + return GetMenstruationComp(pawn)?.curStage ?? HediffComp_Menstruation.Stage.Bleeding; + } + + + public static float GetPregnancyProgress(Pawn pawn) + { + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + return h.GestationProgress; + } + return -1; + } + + public static Pawn GetFetus(Pawn pawn) + { + Hediff hediff = PregnancyHelper.GetPregnancy(pawn); + if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + return h?.babies?.First() ?? null; + } + //else if (hediff is Hediff_HumanlikePregnancy) + //{ + // Hediff_HumanlikePregnancy h = (Hediff_HumanlikePregnancy)hediff; + // return h?.babies?.First() ?? null; + //} + //else if (hediff is Hediff_BestialPregnancy) + //{ + // Hediff_BestialPregnancy h = (Hediff_BestialPregnancy)hediff; + // return h?.babies?.First() ?? null; + //} + else if (hediff is Hediff_MechanoidPregnancy) + { + Hediff_MechanoidPregnancy h = (Hediff_MechanoidPregnancy)hediff; + return h?.babies?.First() ?? null; + } + + + return null; + } + + + + public static Texture2D GetPregnancyIcon(HediffComp_Menstruation comp, Hediff hediff) + { + string icon = ""; + if (hediff is Hediff_MechanoidPregnancy) + { + return ContentFinder.Get(("Womb/Mechanoid_Fluid"), true); + } + else if (hediff is Hediff_BasePregnancy) + { + Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; + string fetustex = DefDatabase.GetNamedSilentFail(h.babies.First().def.defName)?.fetusTexPath ?? "Fetus/Fetus_Default"; + if (h.GestationProgress < 0.2f) icon = comp.Props.wombTex + "_Implanted"; + else if (h.GestationProgress < 0.3f) icon += "Fetus/Fetus_Early00"; + else if (h.GestationProgress < 0.4f) icon += fetustex + "00"; + else if (h.GestationProgress < 0.5f) icon += fetustex + "01"; + else if (h.GestationProgress < 0.6f) icon += fetustex + "02"; + else if (h.GestationProgress < 0.7f) icon += fetustex + "03"; + else if (h.GestationProgress < 0.8f) icon += fetustex + "04"; + else icon += fetustex + "05"; + } + else icon = "Fetus/Slime_Abomi02"; + return ContentFinder.Get((icon), true); + } + + public static Texture2D GetCumIcon(HediffComp_Menstruation comp) + { + string icon = "Womb/"; + float cumpercent = comp.TotalCumPercent; + if (cumpercent < 0.001f) icon += "Empty"; + else if (cumpercent < 0.01f) icon += "Cum_00"; + else if (cumpercent < 0.05f) icon += "Cum_01"; + else if (cumpercent < 0.11f) icon += "Cum_02"; + else if (cumpercent < 0.17f) icon += "Cum_03"; + else if (cumpercent < 0.23f) icon += "Cum_04"; + else if (cumpercent < 0.29f) icon += "Cum_05"; + else if (cumpercent < 0.35f) icon += "Cum_06"; + else if (cumpercent < 0.41f) icon += "Cum_07"; + else if (cumpercent < 0.47f) icon += "Cum_08"; + else if (cumpercent < 0.53f) icon += "Cum_09"; + else if (cumpercent < 0.59f) icon += "Cum_10"; + else if (cumpercent < 0.65f) icon += "Cum_11"; + else if (cumpercent < 0.71f) icon += "Cum_12"; + else if (cumpercent < 0.77f) icon += "Cum_13"; + else if (cumpercent < 0.83f) icon += "Cum_14"; + else if (cumpercent < 0.89f) icon += "Cum_15"; + else if (cumpercent < 0.95f) icon += "Cum_16"; + else icon += "Cum_17"; + Texture2D cumtex = ContentFinder.Get((icon), true); + return cumtex; + } + + public static Texture2D GetWombIcon(HediffComp_Menstruation comp) + { + string icon = comp.Props.wombTex; + HediffComp_Menstruation.Stage stage = comp.curStage; + if (stage == HediffComp_Menstruation.Stage.Bleeding) icon += "_Bleeding"; + + Texture2D wombtex = ContentFinder.Get((icon), true); + + return wombtex; + } + + public static Texture2D GetGenitalIcon(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + string icon = "Genitals/"; + if (hediff.Severity < 0.20f) icon += "Vagina00"; //micro + else if (hediff.Severity < 0.30f) icon += "Vagina01"; //tight + else if (hediff.Severity < 0.40f) icon += "Vagina02"; //tight + else if (hediff.Severity < 0.47f) icon += "Vagina03"; //average + else if (hediff.Severity < 0.53f) icon += "Vagina04"; //average + else if (hediff.Severity < 0.60f) icon += "Vagina05"; //average + else if (hediff.Severity < 0.70f) icon += "Vagina06"; //accomodating + else if (hediff.Severity < 0.80f) icon += "Vagina07"; //accomodating + else if (hediff.Severity < 0.87f) icon += "Vagina08"; //cavernous + else if (hediff.Severity < 0.94f) icon += "Vagina09"; //cavernous + else if (hediff.Severity < 1.01f) icon += "Vagina10"; //cavernous + else icon += "Vagina11"; //abyssal + + return ContentFinder.Get((icon), true); + } + + public static Texture2D GetAnalIcon(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus")); + string icon = "Genitals/"; + if (hediff.Severity < 0.20f) icon += "Anal00"; //micro + else if (hediff.Severity < 0.40f) icon += "Anal01"; //tight + else if (hediff.Severity < 0.60f) icon += "Anal02"; //average + else if (hediff.Severity < 0.80f) icon += "Anal03"; //accomodating + else if (hediff.Severity < 1.01f) icon += "Anal04"; //cavernous + else icon += "Anal05"; //abyssal + + return ContentFinder.Get((icon), true); + } + + public static string GetVaginaLabel(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina")); + return hediff.LabelBase + "\n" + hediff.LabelInBrackets; + } + public static string GetAnusLabel(Pawn pawn) + { + var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus")); + return hediff.Label; + } + + + + + } +} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/VariousDefOf.cs b/source/RJW_Menstruation3/RJW_Menstruation/VariousDefOf.cs new file mode 100644 index 0000000..e84a4da --- /dev/null +++ b/source/RJW_Menstruation3/RJW_Menstruation/VariousDefOf.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using rjw; + +namespace RJW_Menstruation +{ + public static class VariousDefOf + { + public static readonly DNADef defaultDNA = new DNADef + { + fetusTexPath = "Fetus/Fetus_Default", + cumColor = new ColorInt(255, 255, 255, 255), + cumTickness = 0 + }; + + public static readonly ThingDef CumFilth = DefDatabase.GetNamed("FilthCum"); + public static readonly HediffDef RJW_IUD = DefDatabase.GetNamed("RJW_IUD"); + + } +}