From 8d541c78c90e0b8a0389b724347bb38ab34bf209 Mon Sep 17 00:00:00 2001 From: Vegapnk Date: Wed, 19 Apr 2023 08:09:33 +0200 Subject: [PATCH] Start of Caste System --- Common/Defs/GeneDefs/GeneDefs_Hive.xml | 126 +++++++++++++++++- .../ConditionalStatAffecter_MultipleQueens.cs | 26 ++++ .../ConditionalStatAffecter_QueenAbsent.cs | 26 ++++ .../ConditionalStatAffecter_QueenCloseBy.cs | 28 ++++ Source/Rjw-Genes.csproj | 3 + 5 files changed, 207 insertions(+), 2 deletions(-) create mode 100644 Source/Genes/Hive/Genes/ConditionalStatAffecters/ConditionalStatAffecter_MultipleQueens.cs create mode 100644 Source/Genes/Hive/Genes/ConditionalStatAffecters/ConditionalStatAffecter_QueenAbsent.cs create mode 100644 Source/Genes/Hive/Genes/ConditionalStatAffecters/ConditionalStatAffecter_QueenCloseBy.cs diff --git a/Common/Defs/GeneDefs/GeneDefs_Hive.xml b/Common/Defs/GeneDefs/GeneDefs_Hive.xml index 5ea010c..fa978fc 100644 --- a/Common/Defs/GeneDefs/GeneDefs_Hive.xml +++ b/Common/Defs/GeneDefs/GeneDefs_Hive.xml @@ -1,6 +1,128 @@ - + + rjw_genes_queen + + queen + This gene represents the royal caste amongst its xenotype. Children of a queen are usually born as sterile workers, unless the father was a drone. Having multiple (adult) queens leads to intense rivalry and can throw the whole colony into chaos! + Things/Mote/Heart + 1 + rjw_genes_hive + + + 0.5 + 0.25 + + +
  • + + 0.7 + + + -0.5 + +
  • + +
  • + + 0.4 + 0.2 + +
  • + + +
  • rjw_genes_hive_caste
  • +
    + + 7 + -3 +
    + + + rjw_genes_drone + + drone + This gene represents the drone caste amongst its xenotype. Drones are highly specialised experts that ensure the hives functioning. Other than that, drones are the only xenotypes capable of producing fertile offspring with a queen. + Things/Mote/Heart + 2 + rjw_genes_hive + + +
  • rjw_genes_hive_caste
  • +
    + + +
  • + + 0.9 + + + -0.1 + +
  • +
    + + 4 + -2 +
    + + + + rjw_genes_worker + + worker + This gene represents the lowest caste of a hive, the workers. Usually sterile, they are despised by higher castes and only live to serve with labour. + Things/Mote/Heart + 3 + rjw_genes_hive + + +
  • rjw_genes_hive_caste
  • +
    + + +
  • + + 0.7 + + + -0.5 + +
  • +
  • + + 0.7 + + + -0.5 + +
  • +
  • + + 1.2 + 1.2 + +
  • +
    + + 1 + 0 +
    + + + + rjw_genes_zealous_loyalty + + loyalty + Carriers of this gene are genetically wired to worship carriers of the 'Queen'-gene. They receive a massive relation-ship bonus towards the queen and a slight mood bonus. Having multiple queens in the colony causes severe distress. + Things/Mote/Heart + 10 + rjw_genes_hive + + 1 + -1 + + rjw_genes_cocoonweaver @@ -25,7 +147,7 @@ cocooner Carriers of this gene can generate tame spelopedes. Higher psychic-sensitivity will spawn more spelopedes. World/WorldObjects/Expanding/Insects - 11 + 12 rjw_genes_hive
  • rjw_genes_ability_spawn_spelopede
  • diff --git a/Source/Genes/Hive/Genes/ConditionalStatAffecters/ConditionalStatAffecter_MultipleQueens.cs b/Source/Genes/Hive/Genes/ConditionalStatAffecters/ConditionalStatAffecter_MultipleQueens.cs new file mode 100644 index 0000000..bf68255 --- /dev/null +++ b/Source/Genes/Hive/Genes/ConditionalStatAffecters/ConditionalStatAffecter_MultipleQueens.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using RimWorld; +using Verse; + +namespace RJW_Genes +{ + + /// + /// Checks if there are multiple queens on the map. + /// + public class ConditionalStatAffecter_MultipleQueens : ConditionalStatAffecter + { + public override string Label => (string)"StatsReport_MultipleQueens".Translate(); + + public override bool Applies(StatRequest req) + { + // => ModsConfig.BiotechActive && req.HasThing && req.Thing.Spawned && req.Thing.Position.InSunlight(req.Thing.Map); + throw new NotImplementedException(); + } + } +} diff --git a/Source/Genes/Hive/Genes/ConditionalStatAffecters/ConditionalStatAffecter_QueenAbsent.cs b/Source/Genes/Hive/Genes/ConditionalStatAffecters/ConditionalStatAffecter_QueenAbsent.cs new file mode 100644 index 0000000..e0bb7e1 --- /dev/null +++ b/Source/Genes/Hive/Genes/ConditionalStatAffecters/ConditionalStatAffecter_QueenAbsent.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using RimWorld; +using Verse; + +namespace RJW_Genes +{ + + /// + /// Checks if there is no queen on the map. + /// + public class ConditionalStatAffecter_QueenAbsent : ConditionalStatAffecter + { + public override string Label => (string)"StatsReport_QueenAbsent".Translate(); + + public override bool Applies(StatRequest req) + { + //ModsConfig.BiotechActive && req.HasThing && req.Thing.Spawned && req.Thing.Position.InSunlight(req.Thing.Map); + throw new NotImplementedException(); + } + } +} diff --git a/Source/Genes/Hive/Genes/ConditionalStatAffecters/ConditionalStatAffecter_QueenCloseBy.cs b/Source/Genes/Hive/Genes/ConditionalStatAffecters/ConditionalStatAffecter_QueenCloseBy.cs new file mode 100644 index 0000000..7e9087d --- /dev/null +++ b/Source/Genes/Hive/Genes/ConditionalStatAffecters/ConditionalStatAffecter_QueenCloseBy.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using RimWorld; +using Verse; + +namespace RJW_Genes +{ + + /// + /// Checks if there is (exactly) one queen nearby. + /// If the pawn is a queen itself, it's checked if there are OTHER queens nearby. + /// While this is used for mostly positive things for workers and drones, for queens it checks if there is a rival nearby. + /// + public class ConditionalStatAffecter_QueenCloseBy : ConditionalStatAffecter + { + public override string Label => (string)"StatsReport_QueenCloseBy".Translate(); + + public override bool Applies(StatRequest req) + { + // => ModsConfig.BiotechActive && req.HasThing && req.Thing.Spawned && req.Thing.Position.InSunlight(req.Thing.Map); + throw new NotImplementedException(); + } + } +} diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj index 95fa262..a8ead0a 100644 --- a/Source/Rjw-Genes.csproj +++ b/Source/Rjw-Genes.csproj @@ -196,5 +196,8 @@ False + + + \ No newline at end of file