diff --git a/1.3/Assemblies/AndroidTiers.dll b/1.3/Assemblies/AndroidTiers.dll index fd06624..3b13936 100644 Binary files a/1.3/Assemblies/AndroidTiers.dll and b/1.3/Assemblies/AndroidTiers.dll differ diff --git a/Source/Androids For RW1.3/Incidents/Incident_RansomWare.cs b/Source/Androids For RW1.3/Incidents/Incident_RansomWare.cs index ae5c95c..1cc9df9 100644 --- a/Source/Androids For RW1.3/Incidents/Incident_RansomWare.cs +++ b/Source/Androids For RW1.3/Incidents/Incident_RansomWare.cs @@ -52,10 +52,15 @@ protected override bool TryExecuteWorker(IncidentParms parms) //Bad traits added if (Rand.Chance(0.5f)) { - List tr = Utils.RansomAddedBadTraits.ToList(); + List tr; + if (victim.IsAndroid()) + tr = Utils.RansomAddedBadTraitsAndroid.ToList(); + else + tr = Utils.RansomAddedBadTraits.ToList(); + //Purge des traits deja possédé par la victime ET incompatibles avec ceux present - foreach(var t in Utils.RansomAddedBadTraits) + foreach (var t in Utils.RansomAddedBadTraits) { foreach(var t2 in victim.story.traits.allTraits) { @@ -72,6 +77,13 @@ protected override bool TryExecuteWorker(IncidentParms parms) cso.ransomwareTraitAdded = tr.RandomElement(); victim.story.traits.GainTrait(new Trait(cso.ransomwareTraitAdded, 0, true)); + //If trait is disabled or cannot be applied then we cancel this incident + if (!victim.story.traits.HasTrait(cso.ransomwareTraitAdded)) + { + cso.clearRansomwareVar(); + return false; + } + fee = Rand.Range(Settings.ransomwareMinSilverToPayForBasTrait, Settings.ransomwareMaxSilverToPayForBasTrait); string traitLabel=""; diff --git a/Source/Androids For RW1.3/Utils/GC_ATPP.cs b/Source/Androids For RW1.3/Utils/GC_ATPP.cs index 70651ee..37add7c 100644 --- a/Source/Androids For RW1.3/Utils/GC_ATPP.cs +++ b/Source/Androids For RW1.3/Utils/GC_ATPP.cs @@ -810,6 +810,15 @@ public GC_ATPP(Game game) Utils.RansomAddedBadTraits.Add(t); } + selTraits = new List { "Brawler", "Ascetic", "Gourmand", "SlowLearner", "Undergrounder", "DislikesMen", "DislikesWomen" }; + + foreach (var st in selTraits) + { + t = DefDatabase.GetNamed(st, false); + if (t != null) + Utils.RansomAddedBadTraitsAndroid.Add(t); + } + //Si presence HellUnit ajout schema creation surrogate, sinon suppression recipedefs RecipeDef recipHU = DefDatabase.GetNamed("ATPP_CreateHellDrone"); ThingDef tdHU = DefDatabase.GetNamed("ATPP_SHUSurrogateGeneratorAI"); diff --git a/Source/Androids For RW1.3/Utils/Utils.cs b/Source/Androids For RW1.3/Utils/Utils.cs index 07b73bc..5d480e7 100644 --- a/Source/Androids For RW1.3/Utils/Utils.cs +++ b/Source/Androids For RW1.3/Utils/Utils.cs @@ -103,7 +103,8 @@ public static class Utils public static List VirusedRandomMentalBreak = new List(); public static List RansomAddedBadTraits = new List(); - + public static List RansomAddedBadTraitsAndroid = new List(); + //public static Color SXColor = new Color(0.463f, 0.62f, 0.463f); public static Color SXColor = new Color(0.280f, 0.280f, 0.280f); diff --git a/Source/Androids For RW1.3/obj/Debug/AndroidTiers.dll b/Source/Androids For RW1.3/obj/Debug/AndroidTiers.dll index fd06624..3b13936 100644 Binary files a/Source/Androids For RW1.3/obj/Debug/AndroidTiers.dll and b/Source/Androids For RW1.3/obj/Debug/AndroidTiers.dll differ