mirror of
https://gitgud.io/c0ffeeeeeeee/coffees-rjw-ideology-addons.git
synced 2024-08-14 23:57:38 +00:00
null partner bugfix
This commit is contained in:
parent
0d112972ef
commit
91d05d0e1e
13 changed files with 312 additions and 3 deletions
83
CRIALactation/CRIALactation.csproj
Normal file
83
CRIALactation/CRIALactation.csproj
Normal file
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{01BE0D84-9292-4F89-90FC-647B66771C61}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CRIALactation</RootNamespace>
|
||||
<AssemblyName>CRIALactation</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>1.3\Assemblies\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>..\..\..\..\..\workshop\content\294100\2009463077\Current\Assemblies\0Harmony.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="HugsLib">
|
||||
<HintPath>..\..\..\..\..\workshop\content\294100\818773962\v1.3\Assemblies\HugsLib.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Milk">
|
||||
<HintPath>..\..\rjw-mc-master\1.3\Assemblies\Milk.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="RJW">
|
||||
<HintPath>..\..\rjw\1.3\Assemblies\RJW.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Source\HediffDefOf\HediffDefOf_Milk.cs" />
|
||||
<Compile Include="Source\LactationUtility.cs" />
|
||||
<Compile Include="Source\Precepts\Precept_Lactation.cs" />
|
||||
<Compile Include="Source\Thoughts\ThoughtWorker_Precept_Lactating_Essential.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Content Include="Defs\PreceptDefs\Precepts_Lactating.xml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
48
CRIALactation/Defs/PreceptDefs/Precepts_Lactating.xml
Normal file
48
CRIALactation/Defs/PreceptDefs/Precepts_Lactating.xml
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
|
||||
<!--Issue-->
|
||||
<!--
|
||||
<IssueDef>
|
||||
<defName>Lactation</defName>
|
||||
<label>lactation</label>
|
||||
<iconPath>UI/Issues/MeatEating</iconPath>
|
||||
</IssueDef>
|
||||
|
||||
<PreceptDef>
|
||||
<defName>Lactating_Essential</defName>
|
||||
<issue>Lactation</issue>
|
||||
<label>essential</label>
|
||||
<description>Milk from breasts is healthy and delicious. It should be produced and consumed by everyone on a regular basis.</description>
|
||||
<comps>
|
||||
|
||||
|
||||
<li Class="PreceptComp_SituationalThought">
|
||||
<thought>Lactating_Essential</thought>
|
||||
<description>Pawns with sizeable breasts should be producing milk</description>
|
||||
</li>
|
||||
|
||||
|
||||
</comps>
|
||||
</PreceptDef>
|
||||
|
||||
|
||||
<ThoughtDef>
|
||||
<defName>Lactating_Essential</defName>
|
||||
<thoughtClass>Thought_Situational</thoughtClass>
|
||||
<workerClass>CRIALactation.ThoughtWorker_Precept_Lactating_Essential</workerClass>
|
||||
<stages>
|
||||
<li>
|
||||
<label>producing milk</label>
|
||||
<description>Expressing milk for my friends and family fills me with maternal pride.</description>
|
||||
<baseMoodEffect>7</baseMoodEffect>
|
||||
</li>
|
||||
<li>
|
||||
<label>not producing milk</label>
|
||||
<description>I'm as useless as a dry well.</description>
|
||||
<baseMoodEffect>-12</baseMoodEffect>
|
||||
</li>
|
||||
</stages>
|
||||
</ThoughtDef>
|
||||
-->
|
||||
</Defs>
|
36
CRIALactation/Properties/AssemblyInfo.cs
Normal file
36
CRIALactation/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("CRIALactation")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CRIALactation")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("01be0d84-9292-4f89-90fc-647b66771c61")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
26
CRIALactation/Source/HediffDefOf/HediffDefOf_Milk.cs
Normal file
26
CRIALactation/Source/HediffDefOf/HediffDefOf_Milk.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using RimWorld;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
|
||||
namespace CRIALactation
|
||||
{
|
||||
[DefOf]
|
||||
public static class HediffDefOf_Milk {
|
||||
static HediffDefOf_Milk()
|
||||
{
|
||||
DefOfHelper.EnsureInitializedInCtor(typeof(HediffDefOf_Milk));
|
||||
}
|
||||
|
||||
public static HediffDef Lactating_Drug;
|
||||
public static HediffDef Lactating_Permanent;
|
||||
public static HediffDef Heavy_Lactating_Permanent;
|
||||
public static HediffDef Lactating_Natural;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
24
CRIALactation/Source/LactationUtility.cs
Normal file
24
CRIALactation/Source/LactationUtility.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using Milk;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
|
||||
namespace CRIALactation
|
||||
{
|
||||
public static class LactationUtility
|
||||
{
|
||||
|
||||
public static bool IsLactating(Pawn p)
|
||||
{
|
||||
|
||||
return
|
||||
p.health.hediffSet.HasHediff(HediffDefOf_Milk.Lactating_Natural, false) ||
|
||||
p.health.hediffSet.HasHediff(HediffDefOf_Milk.Lactating_Drug, false) ||
|
||||
p.health.hediffSet.HasHediff(HediffDefOf_Milk.Lactating_Permanent, false) ||
|
||||
p.health.hediffSet.HasHediff(HediffDefOf_Milk.Heavy_Lactating_Permanent, false);
|
||||
}
|
||||
}
|
||||
}
|
22
CRIALactation/Source/Precepts/Precept_Lactation.cs
Normal file
22
CRIALactation/Source/Precepts/Precept_Lactation.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
using rjw;
|
||||
using Milk;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CRIALactation
|
||||
{
|
||||
public class Precept_Lactation : Precept
|
||||
{
|
||||
|
||||
public override void Notify_MemberSpawned(Pawn pawn)
|
||||
{
|
||||
base.Notify_MemberSpawned(pawn);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
using rjw;
|
||||
using Milk;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CRIALactation
|
||||
{
|
||||
public class ThoughtWorker_Precept_Lactating_Essential : ThoughtWorker_Precept
|
||||
{
|
||||
|
||||
protected override ThoughtState ShouldHaveThought(Pawn p)
|
||||
{
|
||||
if (ThoughtUtility.ThoughtNullified(p, this.def))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!Genital_Helper.has_breasts(p) || Genital_Helper.has_male_breasts(p))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(LactationUtility.IsLactating(p))
|
||||
{
|
||||
return ThoughtState.ActiveAtStage(0);
|
||||
}
|
||||
|
||||
return ThoughtState.ActiveAtStage(1);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue