mirror of
				https://github.com/vegapnk/RJW-Genes.git
				synced 2024-08-15 00:23:31 +00:00 
			
		
		
		
	LifeForceEmpath uses new XML DefModExtension
This commit is contained in:
		
							parent
							
								
									ef1e3cdd0f
								
							
						
					
					
						commit
						132344b294
					
				
					 6 changed files with 16 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -274,13 +274,19 @@
 | 
			
		|||
				<backgroundPathXenogenes>Genes/Icons/RJW_Genes_Xenogene_Background</backgroundPathXenogenes>
 | 
			
		||||
			</li>
 | 
			
		||||
			<li Class="RJW_Genes.LifeForceEmpathExtension">
 | 
			
		||||
				<!-- One day has 60k ticks, so we check every hour with 60000/24 = 2500-->
 | 
			
		||||
				<tickInterval>2500</tickInterval>
 | 
			
		||||
				<empathDistance>25</empathDistance>
 | 
			
		||||
				<aheagoIncrement>0.02</aheagoIncrement>
 | 
			
		||||
				<satisfactionIncrement>0.01</satisfactionIncrement>
 | 
			
		||||
				<frustratedDecrement>-0.01</frustratedDecrement>
 | 
			
		||||
			</li>
 | 
			
		||||
			<li Class="RJW_Genes.TickIntervalExtension">
 | 
			
		||||
				<!-- One day has 60k ticks, so we check every hour with 60000/24 = 2500-->
 | 
			
		||||
				<tickInterval>2500</tickInterval>
 | 
			
		||||
			</li>
 | 
			
		||||
			<li Class="RJW_Genes.DistanceExtension">
 | 
			
		||||
				<!-- distance 25 means 25 tiles in every direction from the empath.-->
 | 
			
		||||
				<distance>25</distance>
 | 
			
		||||
			</li>
 | 
			
		||||
		</modExtensions>
 | 
			
		||||
	</GeneDef>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,6 +15,6 @@ namespace RJW_Genes
 | 
			
		|||
    /// </summary>
 | 
			
		||||
    public class DistanceExtension : DefModExtension
 | 
			
		||||
    {
 | 
			
		||||
        public int Distance;
 | 
			
		||||
        public int distance;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -14,7 +14,7 @@ namespace RJW_Genes
 | 
			
		|||
        {
 | 
			
		||||
            DistanceExtension distanceExt = defOf.GetModExtension<DistanceExtension>();
 | 
			
		||||
 | 
			
		||||
            int potentialDistance = distanceExt?.Distance ?? fallback;
 | 
			
		||||
            int potentialDistance = distanceExt?.distance ?? fallback;
 | 
			
		||||
 | 
			
		||||
            if (potentialDistance > 0)
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,9 +9,6 @@ namespace RJW_Genes
 | 
			
		|||
{
 | 
			
		||||
    public class LifeForceEmpathExtension : DefModExtension
 | 
			
		||||
    {
 | 
			
		||||
        public int tickInterval;
 | 
			
		||||
        public int empathDistance;
 | 
			
		||||
 | 
			
		||||
        public float aheagoIncrement;
 | 
			
		||||
        public float satisfactionIncrement;
 | 
			
		||||
        public float frustratedDecrement;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,8 +29,8 @@ namespace RJW_Genes
 | 
			
		|||
        {
 | 
			
		||||
            LifeForceEmpathExtension empathExt = GeneDefOf.rjw_genes_lifeforce_empath.GetModExtension<LifeForceEmpathExtension>();
 | 
			
		||||
 | 
			
		||||
            tickInterval = empathExt?.tickInterval ?? TICK_INTERVAL_FALLBACK;
 | 
			
		||||
            empathDistance = empathExt?.empathDistance ?? EMPATH_DISTANCE_FALLBACK;
 | 
			
		||||
            tickInterval =  ModExtensionHelper.GetTickIntervalFromModExtension(GeneDefOf.rjw_genes_lifeforce_empath, TICK_INTERVAL_FALLBACK);
 | 
			
		||||
            empathDistance = ModExtensionHelper.GetTickIntervalFromModExtension(GeneDefOf.rjw_genes_lifeforce_empath, EMPATH_DISTANCE_FALLBACK);
 | 
			
		||||
 | 
			
		||||
            aheagoIncrement = empathExt?.aheagoIncrement ?? AHEAGO_FALLBACK;
 | 
			
		||||
            satisfiedIncrement = empathExt?.satisfactionIncrement ?? SATISFIED_FALLBACK;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -39,7 +39,10 @@
 | 
			
		|||
    <Compile Include="Animal_Inheritance\Settings\RJW_BGSSettings.cs" />
 | 
			
		||||
    <Compile Include="Animal_Inheritance\Settings\RJW_BGSSettingsController.cs" />
 | 
			
		||||
    <Compile Include="Animal_Inheritance\Defs\BestialityGeneInheritanceDef.cs" />
 | 
			
		||||
    <Compile Include="Common\Defs\DistanceExtension.cs" />
 | 
			
		||||
    <Compile Include="Common\Defs\ModExtensionHelper.cs" />
 | 
			
		||||
    <Compile Include="Common\ModLog.cs" />
 | 
			
		||||
    <Compile Include="Common\Defs\TickIntervalExtension.cs" />
 | 
			
		||||
    <Compile Include="GeneDefOf.cs" />
 | 
			
		||||
    <Compile Include="Genes\Breeding\Gene_MechBreeder.cs" />
 | 
			
		||||
    <Compile Include="Genes\Breeding\PatchMechBirth.cs" />
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue