mirror of
				https://github.com/vegapnk/RJW-Genes.git
				synced 2024-08-15 00:23:31 +00:00 
			
		
		
		
	CockEater gene
CockEater gene with ability and negative thoughtdef for target
This commit is contained in:
		
							parent
							
								
									3cf2d44c82
								
							
						
					
					
						commit
						a64cecbab3
					
				
					 9 changed files with 206 additions and 3 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										34
									
								
								Common/Defs/AbilityDefs/Ability_CockEater.xml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								Common/Defs/AbilityDefs/Ability_CockEater.xml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,34 @@
 | 
				
			||||||
 | 
					<?xml version="1.0" encoding="utf-8" ?>
 | 
				
			||||||
 | 
					<Defs>
 | 
				
			||||||
 | 
					  <AbilityDef ParentName="AbilityTouchBase">
 | 
				
			||||||
 | 
					    <defName>rjw_genes_cockeater</defName>
 | 
				
			||||||
 | 
					    <label>Eat Cock</label>
 | 
				
			||||||
 | 
					    <description>Eat the cock of another pawn, restoring fertilin based on the size of the cock.</description>
 | 
				
			||||||
 | 
					    <iconPath>Things/Mote/Heart</iconPath>
 | 
				
			||||||
 | 
					    <stunTargetWhileCasting>true</stunTargetWhileCasting>
 | 
				
			||||||
 | 
					    <displayGizmoWhileUndrafted>true</displayGizmoWhileUndrafted>
 | 
				
			||||||
 | 
					    <disableGizmoWhileUndrafted>false</disableGizmoWhileUndrafted>
 | 
				
			||||||
 | 
					    <warmupMote>Mote_CoagulateStencil</warmupMote>
 | 
				
			||||||
 | 
					    <warmupEffecter>Coagulate</warmupEffecter>
 | 
				
			||||||
 | 
					    <warmupStartSound>Coagulate_Cast</warmupStartSound>
 | 
				
			||||||
 | 
					    <jobDef>CastAbilityOnThingMelee</jobDef>
 | 
				
			||||||
 | 
					    <displayOrder>402</displayOrder>
 | 
				
			||||||
 | 
					    <verbProperties>
 | 
				
			||||||
 | 
					      <verbClass>Verb_CastAbilityTouch</verbClass>
 | 
				
			||||||
 | 
					      <drawAimPie>false</drawAimPie>
 | 
				
			||||||
 | 
					      <range>-1</range>
 | 
				
			||||||
 | 
					      <warmupTime>10</warmupTime>
 | 
				
			||||||
 | 
					      <targetParams>
 | 
				
			||||||
 | 
					        <canTargetAnimals>true</canTargetAnimals>
 | 
				
			||||||
 | 
					        <canTargetSelf>false</canTargetSelf>
 | 
				
			||||||
 | 
					        <canTargetBuildings>false</canTargetBuildings>
 | 
				
			||||||
 | 
					        <canTargetMechs>false</canTargetMechs>
 | 
				
			||||||
 | 
					        <canTargetBloodfeeders>true</canTargetBloodfeeders>
 | 
				
			||||||
 | 
					      </targetParams>
 | 
				
			||||||
 | 
					    </verbProperties>
 | 
				
			||||||
 | 
					    <comps>
 | 
				
			||||||
 | 
					      <li Class="RJW_Genes.CompProperties_AbilityCockEater"> <!-- namespace needs to be changed when copied to another mod-->
 | 
				
			||||||
 | 
					      </li>
 | 
				
			||||||
 | 
					    </comps>
 | 
				
			||||||
 | 
					  </AbilityDef>
 | 
				
			||||||
 | 
					</Defs>
 | 
				
			||||||
| 
						 | 
					@ -24,7 +24,7 @@
 | 
				
			||||||
		</customEffectDescriptions>
 | 
							</customEffectDescriptions>
 | 
				
			||||||
		<symbolPack>
 | 
							<symbolPack>
 | 
				
			||||||
		  <prefixSymbols>
 | 
							  <prefixSymbols>
 | 
				
			||||||
			<li><symbol>hemo</symbol></li>
 | 
								<li><symbol>fert</symbol></li>
 | 
				
			||||||
		  </prefixSymbols>
 | 
							  </prefixSymbols>
 | 
				
			||||||
		</symbolPack>
 | 
							</symbolPack>
 | 
				
			||||||
		<mentalBreakDef>rjw_genes_lifeforce_randomrape</mentalBreakDef>
 | 
							<mentalBreakDef>rjw_genes_lifeforce_randomrape</mentalBreakDef>
 | 
				
			||||||
| 
						 | 
					@ -55,8 +55,35 @@
 | 
				
			||||||
		<symbolPack>
 | 
							<symbolPack>
 | 
				
			||||||
		  <suffixSymbols>
 | 
							  <suffixSymbols>
 | 
				
			||||||
			<li><symbol>life</symbol></li>
 | 
								<li><symbol>life</symbol></li>
 | 
				
			||||||
			<li><symbol>clotter</symbol></li>
 | 
								<li><symbol>pussy</symbol></li>
 | 
				
			||||||
			<li><symbol>tender</symbol></li>
 | 
								<li><symbol>heal</symbol></li>
 | 
				
			||||||
 | 
							  </suffixSymbols>
 | 
				
			||||||
 | 
							</symbolPack>
 | 
				
			||||||
 | 
						</GeneDef>
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						<GeneDef>
 | 
				
			||||||
 | 
							<defName>rjw_genes_cockeater</defName>
 | 
				
			||||||
 | 
							<label>Cockeater</label>
 | 
				
			||||||
 | 
							<labelShortAdj>cockeater</labelShortAdj>
 | 
				
			||||||
 | 
							<description>Carriers of this gene are able eat cocks to restore their fertilin supply.</description>
 | 
				
			||||||
 | 
							<iconPath>Things/Mote/Heart</iconPath>
 | 
				
			||||||
 | 
							<prerequisite>rjw_genes_lifeforce</prerequisite>
 | 
				
			||||||
 | 
							<displayOrderInCategory>11</displayOrderInCategory>
 | 
				
			||||||
 | 
							<displayCategory>rjw_genes_fertilin</displayCategory>
 | 
				
			||||||
 | 
							<abilities>
 | 
				
			||||||
 | 
							  <li>rjw_genes_cockeater</li>
 | 
				
			||||||
 | 
							</abilities>
 | 
				
			||||||
 | 
							<descriptionHyperlinks>
 | 
				
			||||||
 | 
							  <AbilityDef>rjw_genes_cockeater</AbilityDef>
 | 
				
			||||||
 | 
							</descriptionHyperlinks>
 | 
				
			||||||
 | 
							<biostatCpx>1</biostatCpx>
 | 
				
			||||||
 | 
							<biostatMet>-1</biostatMet>
 | 
				
			||||||
 | 
							<minAgeActive>18</minAgeActive>
 | 
				
			||||||
 | 
							<symbolPack>
 | 
				
			||||||
 | 
							  <suffixSymbols>
 | 
				
			||||||
 | 
								<li><symbol>life</symbol></li>
 | 
				
			||||||
 | 
								<li><symbol>cock</symbol></li>
 | 
				
			||||||
 | 
								<li><symbol>eat</symbol></li>
 | 
				
			||||||
		  </suffixSymbols>
 | 
							  </suffixSymbols>
 | 
				
			||||||
		</symbolPack>
 | 
							</symbolPack>
 | 
				
			||||||
	</GeneDef>
 | 
						</GeneDef>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										18
									
								
								Common/Defs/ThoughtDefs/Thoughts_LifeForce.xml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								Common/Defs/ThoughtDefs/Thoughts_LifeForce.xml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,18 @@
 | 
				
			||||||
 | 
					<?xml version="1.0" encoding="utf-8" ?>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<Defs>
 | 
				
			||||||
 | 
						<ThoughtDef>
 | 
				
			||||||
 | 
							<defName>rjw_genes_cock_eaten</defName>
 | 
				
			||||||
 | 
							<thoughtClass>Thought_Memory</thoughtClass>
 | 
				
			||||||
 | 
							<durationDays>30.0</durationDays>
 | 
				
			||||||
 | 
							<stackLimit>100</stackLimit>
 | 
				
			||||||
 | 
							<stackedEffectMultiplier>0.4</stackedEffectMultiplier>
 | 
				
			||||||
 | 
							<stages>
 | 
				
			||||||
 | 
								<li>
 | 
				
			||||||
 | 
									<label>cock eaten</label>
 | 
				
			||||||
 | 
									<description>My cock was eaten directly of my body, I am devestated.</description>
 | 
				
			||||||
 | 
									<baseMoodEffect>-30</baseMoodEffect>
 | 
				
			||||||
 | 
								</li>
 | 
				
			||||||
 | 
							</stages>
 | 
				
			||||||
 | 
						</ThoughtDef>
 | 
				
			||||||
 | 
					</Defs>
 | 
				
			||||||
							
								
								
									
										87
									
								
								Source/Genes/Life_Force/CompAbilityEffect_CockEater.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										87
									
								
								Source/Genes/Life_Force/CompAbilityEffect_CockEater.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,87 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using Verse;
 | 
				
			||||||
 | 
					using UnityEngine;
 | 
				
			||||||
 | 
					using RimWorld;
 | 
				
			||||||
 | 
					using rjw;
 | 
				
			||||||
 | 
					using rjw.Modules.Interactions.Helpers;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace RJW_Genes
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						public class CompAbilityEffect_CockEater : CompAbilityEffect
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							private new CompProperties_AbilityCockEater Props
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								get
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									return (CompProperties_AbilityCockEater)this.props;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							public override void Apply(LocalTargetInfo target, LocalTargetInfo dest)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								base.Apply(target, dest);
 | 
				
			||||||
 | 
								Pawn pawn = target.Pawn;
 | 
				
			||||||
 | 
								if (pawn == null)
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									return;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								var partBPR = Genital_Helper.get_genitalsBPR(pawn);
 | 
				
			||||||
 | 
								var parts = Genital_Helper.get_PartsHediffList(pawn, partBPR);
 | 
				
			||||||
 | 
								if (!parts.NullOrEmpty())
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									foreach (Hediff part in parts)
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										if (GenitaliaChanger.IsArtificial(part))
 | 
				
			||||||
 | 
											continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										if (rjw.Genital_Helper.is_penis(part))
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											GeneUtility.OffsetLifeForce(this.parent.pawn, part.Severity); ;
 | 
				
			||||||
 | 
											pawn.health.RemoveHediff(part);
 | 
				
			||||||
 | 
											pawn.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.rjw_genes_cock_eaten, pawn, null);
 | 
				
			||||||
 | 
											break; //Only one penis at the time
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							public override bool Valid(LocalTargetInfo target, bool throwMessages = false)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								Pawn pawn = target.Pawn;
 | 
				
			||||||
 | 
								if (pawn != null)
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									bool flag = pawn.Faction == this.parent.pawn.Faction || pawn.IsPrisonerOfColony;
 | 
				
			||||||
 | 
									bool flag2 = pawn.HostileTo(this.parent.pawn);
 | 
				
			||||||
 | 
									bool flag3 = pawn.Downed;
 | 
				
			||||||
 | 
									if (!flag && !(flag2 && flag3))
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										if (throwMessages)
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											if(flag2 && !flag3)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
												Messages.Message(pawn.Name + " is hostile, but not downed.", pawn, MessageTypeDefOf.RejectInput, false);
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
											else if (!flag)
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												Messages.Message(pawn.Name + " is not a part of the colony or hostile.", pawn, MessageTypeDefOf.RejectInput, false);
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										return false;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									if (!Genital_Helper.has_penis_fertile(pawn))
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										if (throwMessages)
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											Messages.Message(pawn.Name + " has no penis", pawn, MessageTypeDefOf.RejectInput, false);
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										return false;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								return base.Valid(target, throwMessages);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -38,6 +38,7 @@ namespace RJW_Genes
 | 
				
			||||||
			//FleckMaker.AttachedOverlay(pawn, FleckDefOf.FlashHollow, Vector3.zero, 1.5f, -1f);
 | 
								//FleckMaker.AttachedOverlay(pawn, FleckDefOf.FlashHollow, Vector3.zero, 1.5f, -1f);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Not yet implemented, but the heal should also trigger after normal sex
 | 
				
			||||||
		public void AfterSex(Pawn pawn, Pawn target)
 | 
							public void AfterSex(Pawn pawn, Pawn target)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			List<Hediff> hediffs = target.health.hediffSet.hediffs;
 | 
								List<Hediff> hediffs = target.health.hediffSet.hediffs;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										18
									
								
								Source/Genes/Life_Force/CompProperties_AbilityCockEater.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								Source/Genes/Life_Force/CompProperties_AbilityCockEater.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,18 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using Verse;
 | 
				
			||||||
 | 
					using RimWorld;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace RJW_Genes
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						public class CompProperties_AbilityCockEater : CompProperties_AbilityEffect
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							public CompProperties_AbilityCockEater()
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								this.compClass = typeof(CompAbilityEffect_CockEater);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -116,6 +116,8 @@
 | 
				
			||||||
    <Compile Include="Genes\Genitalia\GenitaliaChanger.cs" />
 | 
					    <Compile Include="Genes\Genitalia\GenitaliaChanger.cs" />
 | 
				
			||||||
    <Compile Include="Genes\Life_Force\AbilityUtility.cs" />
 | 
					    <Compile Include="Genes\Life_Force\AbilityUtility.cs" />
 | 
				
			||||||
    <Compile Include="Genes\Life_Force\CompAbilityEffect_LifeForceCost.cs" />
 | 
					    <Compile Include="Genes\Life_Force\CompAbilityEffect_LifeForceCost.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="Genes\Life_Force\CompAbilityEffect_CockEater.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="Genes\Life_Force\CompProperties_AbilityCockEater.cs" />
 | 
				
			||||||
    <Compile Include="Interactions\CompAbility_SexInteractionRequirements.cs" />
 | 
					    <Compile Include="Interactions\CompAbility_SexInteractionRequirements.cs" />
 | 
				
			||||||
    <Compile Include="Genes\Life_Force\CompAbilityEffect_PussyHeal.cs" />
 | 
					    <Compile Include="Genes\Life_Force\CompAbilityEffect_PussyHeal.cs" />
 | 
				
			||||||
    <Compile Include="Genes\Life_Force\CompProperties_AbilityLifeForceCost.cs" />
 | 
					    <Compile Include="Genes\Life_Force\CompProperties_AbilityLifeForceCost.cs" />
 | 
				
			||||||
| 
						 | 
					@ -144,6 +146,7 @@
 | 
				
			||||||
    <Compile Include="JobDefOf.cs" />
 | 
					    <Compile Include="JobDefOf.cs" />
 | 
				
			||||||
    <Compile Include="Properties\AssemblyInfo.cs" />
 | 
					    <Compile Include="Properties\AssemblyInfo.cs" />
 | 
				
			||||||
    <Compile Include="RJW_Genes.cs" />
 | 
					    <Compile Include="RJW_Genes.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="ThoughtDefOf.cs" />
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
    <Content Include="GeneDefs_GenitaliaTypeEndogenes.xml" />
 | 
					    <Content Include="GeneDefs_GenitaliaTypeEndogenes.xml" />
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										15
									
								
								Source/ThoughtDefOf.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								Source/ThoughtDefOf.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,15 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using RimWorld;
 | 
				
			||||||
 | 
					using Verse;
 | 
				
			||||||
 | 
					namespace RJW_Genes
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						[DefOf]
 | 
				
			||||||
 | 
						public static class ThoughtDefOf
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public static readonly ThoughtDef rjw_genes_cock_eaten;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue