First Draft naked prowess and racegenedef bugfix

This commit is contained in:
Shabakur 2023-01-27 21:30:30 +01:00
parent 43705b9676
commit f1e14befbb
11 changed files with 192 additions and 11 deletions

Binary file not shown.

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<AbilityDef>
<defName>rjw_genes_naked_prowess</defName>
<label>naked prowess</label>
<description>Enhance the strenght and resilience of your naked body with fertilin.</description>
<iconPath>Things/Mote/Heart</iconPath>
<warmupMoteSocialSymbol>Things/Mote/Heart</warmupMoteSocialSymbol>
<jobDef>CastAbilityOnThing</jobDef>
<targetRequired>False</targetRequired>
<canUseAoeToGetTargets>False</canUseAoeToGetTargets>
<stunTargetWhileCasting>True</stunTargetWhileCasting>
<statBases>
<Ability_Duration>126</Ability_Duration>
<Ability_EffectRadius>0</Ability_EffectRadius>
</statBases>
<verbProperties>
<verbClass>Verb_CastAbility</verbClass>
<warmupTime>2</warmupTime>
<range>0</range>
<drawAimPie>False</drawAimPie>
<requireLineOfSight>False</requireLineOfSight>
<targetParams>
<canTargetSelf>true</canTargetSelf>
<canTargetPawns>false</canTargetPawns>
<canTargetBuildings>false</canTargetBuildings>
<canTargetAnimals>false</canTargetAnimals>
<canTargetHumans>false</canTargetHumans>
<canTargetMechs>false</canTargetMechs>
</targetParams>
</verbProperties>
<comps>
<li Class="CompProperties_AbilityGiveHediff">
<compClass>CompAbilityEffect_GiveHediff</compClass>
<hediffDef>rjw_genes_naked_prowess</hediffDef>
<onlyApplyToSelf>True</onlyApplyToSelf>
<replaceExisting>true</replaceExisting>
</li>
<li Class="RJW_Genes.CompProperties_CasterIsNaked"/>
<li Class="RJW_Genes.CompProperties_AbilityLifeForceCost">
<fertilinCost>0.1</fertilinCost>
</li>
</comps>
</AbilityDef>
</Defs>

View File

@ -151,9 +151,27 @@
</symbolPack>
</GeneDef>
<GeneDef>
<defName>rjw_genes_naked_prowess</defName>
<label>naked prowess</label>
<description>Carriers of this gene are able to temporarily increase their strenght and resilience, while they are naked.</description>
<iconPath>Things/Mote/Heart</iconPath>
<prerequisite>rjw_genes_lifeforce</prerequisite>
<displayOrderInCategory>13</displayOrderInCategory>
<displayCategory>rjw_genes_fertilin</displayCategory>
<abilities>
<li>rjw_genes_naked_prowess</li>
</abilities>
<descriptionHyperlinks>
<AbilityDef>rjw_genes_naked_prowess</AbilityDef>
</descriptionHyperlinks>
<biostatCpx>1</biostatCpx>
<biostatMet>-1</biostatMet>
</GeneDef>
<GeneDef>
<defName>rjw_genes_cum_eater</defName>
<label>Cum eater</label>
<label>cum eater</label>
<description>Carriers of this gene are able to absorb fertilin through eating cum.</description>
<iconPath>Things/Mote/Heart</iconPath>
<prerequisite>rjw_genes_lifeforce</prerequisite>

View File

@ -136,4 +136,37 @@
</li>
</comps>
</HediffDef>
<HediffDef ParentName="RoleStatBuff">
<defName>rjw_genes_naked_prowess</defName>
<label>naked prowss</label>
<description>Driven by fertilin, this person has greatly increased strength and resilience.</description>
<hediffClass>HediffWithComps</hediffClass>
<stages>
<li>
<!--Maybe a bit to much, but they are supposed to be strong-->
<statOffsets>
<ArmorRating_Sharp>0.5</ArmorRating_Sharp>
<ArmorRating_Blunt>0.5</ArmorRating_Blunt>
<ArmorRating_Heat>0.5</ArmorRating_Heat>
<!-- <Insulation_Cold>10</Insulation_Cold>
<Insulation_Heat>10</Insulation_Heat> -->
</statOffsets>
<statFactors>
<IncomingDamageFactor>0.5</IncomingDamageFactor>
<MeleeDamageFactor>1.5</MeleeDamageFactor>
</statFactors>
</li>
</stages>
<comps>
<li Class="HediffCompProperties_Disappears">
<showRemainingTime>True</showRemainingTime>
<disappearsAfterTicks>5000</disappearsAfterTicks> <!-- 2 hours -->
</li>
<li Class="HediffCompProperties_DisappearsOnDeath"/>
<!--TODO: Make hediff disappear if pawn is nolonger naked-->
</comps>
<isBad>false</isBad>
</HediffDef>
</Defs>

View File

@ -28,13 +28,16 @@ namespace RJW_BGS
ModLog.Warning($"Error looking up PawnKindDef for {pawn.Name} - Could not lookup Animal Inheritance Genes");
return null;
}
string raceName = kindDef.race.defName;
string pawnKindName = kindDef.defName;
//Wild animals have no name, so we will use pawnkindname instead
string pawnName = pawn.Name != null ? pawn.Name.ToStringFull : pawnKindName;
PawnData pawnData = SaveStorage.DataStore.GetPawnData(pawn);
RaceGroupDef raceGroupDef = pawnData.RaceSupportDef;
if (RJW_BGSSettings.rjw_bgs_detailed_debug)
ModLog.Message($"Looking up Animal-Inheritable Genes for {pawn.Name} with KindDef {kindDef.defName},RaceName {raceName}, PawnKind {pawnKindName} and RaceGroup {raceGroupDef.defName}");
ModLog.Message($"Looking up Animal-Inheritable Genes for {pawnName} with KindDef {kindDef.defName},RaceName {raceName}, PawnKind {pawnKindName} and RaceGroup {raceGroupDef.defName}");
IEnumerable<RaceGeneDef> allDefs = DefDatabase<RaceGeneDef>.AllDefs;
List<RaceGeneDef> pawnKindDefs = allDefs.Where(delegate (RaceGeneDef group)
@ -44,11 +47,11 @@ namespace RJW_BGS
}).ToList<RaceGeneDef>();
if (pawnKindDefs.Count() > 0)
{
DebugPrintRaceGeneDefs("PawnKindDefs",pawn.Name.ToStringFull,pawnKindDefs);
DebugPrintRaceGeneDefs("PawnKindDefs", pawnName,pawnKindDefs);
return pawnKindDefs;
}
else if (RJW_BGSSettings.rjw_bgs_detailed_debug)
ModLog.Message($"Did not find PawnKindDefs for {pawn.Name.ToStringFull}");
ModLog.Message($"Did not find PawnKindDefs for {pawnName}");
List<RaceGeneDef> raceKindDefs = allDefs.Where(delegate (RaceGeneDef group)
{
@ -57,11 +60,11 @@ namespace RJW_BGS
}).ToList<RaceGeneDef>();
if (raceKindDefs.Count() > 0)
{
DebugPrintRaceGeneDefs("PawnKindDefs", pawn.Name.ToStringFull, raceKindDefs);
DebugPrintRaceGeneDefs("PawnKindDefs", pawnName, raceKindDefs);
return raceKindDefs;
}
else if (RJW_BGSSettings.rjw_bgs_detailed_debug)
ModLog.Message($"Did not find RaceKindDefs for {pawn.Name.ToStringFull}");
ModLog.Message($"Did not find RaceKindDefs for {pawnName}");
List<RaceGeneDef> raceGroupDefs = new List<RaceGeneDef>();
if (raceGroupDef != null)
@ -77,13 +80,13 @@ namespace RJW_BGS
if (raceGroupDefs.Count() > 0)
{
DebugPrintRaceGeneDefs("RaceKindDefs", pawn.Name.ToStringFull, raceGroupDefs);
DebugPrintRaceGeneDefs("RaceKindDefs", pawnName, raceGroupDefs);
return raceGroupDefs;
}
else if (RJW_BGSSettings.rjw_bgs_detailed_debug)
ModLog.Message($"Did not find RaceGroupDefs for {pawn.Name.ToStringFull}");
ModLog.Message($"Did not find RaceGroupDefs for {pawnName}");
ModLog.Message($"Did not find any Genes inheritable for {pawn.Name.ToStringFull}");
ModLog.Message($"Did not find any Genes inheritable for {pawnName}");
return new List<RaceGeneDef>();
}

View File

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using Verse.AI;
using rjw;
namespace RJW_Genes
{
//Summary//
//Returns invalid if a pawn is not naked
//Summary//
public class CompAbilityEffect_CasterIsNaked : CompAbilityEffect_WithDest
{
private new CompProperties_CasterIsNaked Props
{
get
{
return (CompProperties_CasterIsNaked)this.props;
}
}
public override bool GizmoDisabled(out string reason)
{
Pawn pawn = this.CasterPawn;
if (pawn != null)
{
//Copied from ThoughtWorker_NudistNude.CurrentStateInternal
List<Apparel> wornApparel = pawn.apparel.WornApparel;
for (int i = 0; i < wornApparel.Count; i++)
{
Apparel apparel = wornApparel[i];
if (apparel.def.apparel.countsAsClothingForNudity)
{
for (int j = 0; j < apparel.def.apparel.bodyPartGroups.Count; j++)
{
if (apparel.def.apparel.bodyPartGroups[j] == BodyPartGroupDefOf.Torso)
{
reason = pawn.Name + " is not naked";
return true;
}
if (apparel.def.apparel.bodyPartGroups[j] == BodyPartGroupDefOf.Legs)
{
reason = pawn.Name + " is not naked";
return true;
}
}
}
}
}
reason = null;
return false;
}
}
}

View File

@ -0,0 +1,19 @@
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_CasterIsNaked : CompProperties_EffectWithDest
{
public CompProperties_CasterIsNaked()
{
this.compClass = typeof(CompAbilityEffect_CasterIsNaked);
}
}
}

View File

@ -61,10 +61,8 @@ namespace RJW_Genes
return AlertReport.CulpritsAre(this.Targets);
}
// Token: 0x04004B5C RID: 19292
private List<GlobalTargetInfo> targets = new List<GlobalTargetInfo>();
// Token: 0x04004B5D RID: 19293
private List<string> targetLabels = new List<string>();
}
}

View File

@ -49,6 +49,7 @@ namespace RJW_Genes
if (this.Pawn.genes.HasGene(GeneDefOf.rjw_genes_cum_eater)
|| this.Pawn.genes.HasGene(GeneDefOf.rjw_genes_vaginal_absorber) || this.Pawn.genes.HasGene(GeneDefOf.rjw_genes_anal_absorber) || this.Pawn.genes.HasGene(GeneDefOf.rjw_genes_drainer))
{
//TODO: use mentalstatedef instead of mentalbreakdef
MentalBreakDef randomrape = GeneDefOf.rjw_genes_lifeforce_randomrape;
if (ModsConfig.BiotechActive &&
this.Pawn.Spawned && !this.Pawn.InMentalState && !this.Pawn.Downed &&

View File

@ -27,6 +27,7 @@ namespace RJW_Genes
// Gene: Generous Donor [Postfix Patch]
harmony.Patch(AccessTools.Method(typeof(LicentiaLabs.CumflationHelper), nameof(LicentiaLabs.CumflationHelper.TransferNutrition)),
postfix: new HarmonyMethod(typeof(Patch_TransferNutrition), nameof(Patch_TransferNutrition.Postfix)));
//Eat cumflation
harmony.Patch(AccessTools.Method(typeof(rjw.JobDriver_Sex), nameof(rjw.JobDriver_Sex.ChangePsyfocus)),
postfix: new HarmonyMethod(typeof(Patch_SexTicks_ChangePsyfocus), nameof(Patch_SexTicks_ChangePsyfocus.Postfix)));
}

View File

@ -125,6 +125,8 @@
<Compile Include="Genes\Genitalia\Gene_EquineGenitalia.cs" />
<Compile Include="Genes\Genitalia\GenitaliaChanger.cs" />
<Compile Include="Genes\Life_Force\Abilities\AbilityUtility.cs" />
<Compile Include="Genes\Life_Force\Abilities\CompAbilityEffect_CasterIsNaked.cs" />
<Compile Include="Genes\Life_Force\Abilities\CompProperties_CasterIsNaked.cs" />
<Compile Include="Genes\Life_Force\Alert_LowFertilin.cs" />
<Compile Include="Genes\Life_Force\Abilities\CompAbilityEffect_Seduce.cs" />
<Compile Include="Genes\Life_Force\Abilities\CompAbilityEffect_LifeForceCost.cs" />