mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
quirk framework
This commit is contained in:
parent
a9a49a4214
commit
38f9e43e42
3 changed files with 29 additions and 14 deletions
Binary file not shown.
|
@ -49,7 +49,7 @@
|
|||
<backgroundPathXenogenes>Genes/Icons/RJW_Genes_Xenogene_Background</backgroundPathXenogenes>
|
||||
</li>
|
||||
<li Class="RJW_Genes.QirkExtension">
|
||||
<Satisfiedquirk>DemonLover</Satisfiedquirk>
|
||||
<Satisfiedquirk>DemonLoverQuirk</Satisfiedquirk>
|
||||
</li>
|
||||
</modExtensions>
|
||||
</GeneDef>
|
||||
|
@ -107,7 +107,7 @@
|
|||
<backgroundPathXenogenes>Genes/Icons/RJW_Genes_Xenogene_Background</backgroundPathXenogenes>
|
||||
</li>
|
||||
<li Class="RJW_Genes.QirkExtension">
|
||||
<Satisfiedquirk>DemonLover</Satisfiedquirk>
|
||||
<Satisfiedquirk>DemonLoverQuirk</Satisfiedquirk>
|
||||
</li>
|
||||
</modExtensions>
|
||||
</GeneDef>
|
||||
|
|
|
@ -3,34 +3,49 @@ using RimWorld;
|
|||
using rjw;
|
||||
using System.Collections.Generic;
|
||||
using rjw.Modules.Quirks;
|
||||
using System;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class QuirkPatcher
|
||||
{
|
||||
public static void CountSatisfiedPostfix(ref int __result, SexProps props)
|
||||
{/*
|
||||
{
|
||||
Pawn pawn = props.pawn;
|
||||
Pawn partner = props.partner;
|
||||
int count= 0;
|
||||
List<Quirk> listquirk= new List<Quirk>();
|
||||
Quirk q = null;
|
||||
foreach(Gene g in partner.genes.GenesListForReading) {
|
||||
int count = 0;
|
||||
List<string> listquirk = new List<string>();
|
||||
string s;
|
||||
foreach (Gene g in partner.genes.GenesListForReading)
|
||||
{
|
||||
if (partner.genes.HasActiveGene(g.def))
|
||||
{
|
||||
g.def?.GetModExtension<QirkExtension>().Satisfiedquirk;
|
||||
listquirk.Add(g.def?.GetModExtension<QirkExtension>().Satisfiedquirk);
|
||||
s = null;
|
||||
s = g.def?.GetModExtension<QirkExtension>()?.Satisfiedquirk;
|
||||
if (!string.IsNullOrEmpty(s))
|
||||
{
|
||||
listquirk.Add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Quirk q in listquirk)
|
||||
foreach (Quirk q in Quirk.All)
|
||||
{
|
||||
if (pawn.Has(q)){
|
||||
count++;
|
||||
if (pawn.Has(q))
|
||||
{
|
||||
|
||||
foreach (string s2 in listquirk)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(s2))
|
||||
if (q.LocaliztionKey==s2)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
__result = __result + count;
|
||||
return;*/
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue