Example #1
0
        public static void Postfix(GeoMission mission)
        {
            try
            {
                if (!Mod.Settings.Regeneration)
                {
                    return;
                }
                //FileLog.Log(mission.Squad.Soldiers.Count().ToString());
                foreach (var phoenixFactionSoldier in mission.Squad.Soldiers)
                {
                    // FileLog.Log($"{phoenixFactionSoldier.DisplayName}");
                    // FileLog.Log(phoenixFactionSoldier.GetBodyParts().ToArray()[0].name);
                    // Human_Torso_BodyPartDef

                    // phoenixFactionSoldier.GetTacticalAbilities().Do(x => FileLog.Log(x.name));
                    // Heavy_ClassProficiency_AbilityDef
                    // Brawler_AbilityDef
                    // WarCry_AbilityDef

                    // phoenixFactionSoldier.ArmourItems.FirstOrDefault(x => x.CommonItemData.GetDisplayName() == "Regeneration Torso")?.ItemDef.Abilities.Do(x => FileLog.Log(x.name));
                    // Regeneration_Torso_Passive_AbilityDef
                    // phoenixFactionSoldier.ArmourItems.FirstOrDefault(x => x.CommonItemData.GetDisplayName() == "Regeneration Torso")?.ItemDef.Abilities.Do(x => FileLog.Log(x.Guid));
                    // d7f6a180-f767-ed74-18f9-22a90ba2828c
                    // phoenixFactionSoldier.ArmourItems.FirstOrDefault(x => x.CommonItemData.GetDisplayName() == "Regeneration Torso")?.ItemDef.Abilities.Do(x => FileLog.Log(x.ResourcePath));
                    // Defs/Tactical/Actors/_Common/Abilities/Regeneration_Torso_Passive_AbilityDef

                    if (phoenixFactionSoldier.ArmourItems.Any(x =>
                                                              x.CommonItemData.ItemDef.Abilities.Any(y => y.Guid == "d7f6a180-f767-ed74-18f9-22a90ba2828c")))
                    {
                        //FileLog.Log($"Healing {phoenixFactionSoldier.DisplayName}.");
                        phoenixFactionSoldier.Heal(float.MaxValue);
                    }
                }
            }
            catch (Exception e)
            {
                FileLog.Log(e.ToString());
            }
        }
Example #2
0
 private static void AfterSiteMission_AmendLog(GeoSite site, GeoMission mission, List <GeoscapeLogEntry> ____entries)
 {
     try {
         if (!(mission is GeoHavenDefenseMission defense) || DefenseMission == null)
         {
             return;
         }
         var attacker = DefenseMission.GetEnemyFaction();
         if (!CauseZoneDamage(attacker))
         {
             return;
         }
         LocalizedTextBind zoneName = defense.AttackedZone?.Def?.ViewElementDef?.DisplayName1;
         if (zoneName == null || ____entries == null || ____entries.Count < 1)
         {
             return;
         }
         GeoscapeLogEntry entry = ____entries[____entries.Count - 1];
         Verbo("Converting {0} invasion message to zone invasion.", attacker.GetPPName());
         entry.Parameters[0] = new LocalizedTextBind(site.SiteName.Localize() + " " + TitleCase(zoneName.Localize()), true);
     } catch (Exception ex) { Error(ex); }
 }
Example #3
0
        private static void BeforeCalculate_Readjust(DynamicDifficultySystem __instance, GeoMission mission, Dictionary <DifficultyThreatLevel, DynamicDifficultySystem.DeploymentModifier> ____deploymentModPerThreatLevel)
        {
            try {
                Info("Deploy Modifier: Min {0} Cur {1}",
                     ____deploymentModPerThreatLevel[mission.ThreatLevel].MinDeploymentModifier,
                     ____deploymentModPerThreatLevel[mission.ThreatLevel].CurrentDeploymentModifier
                     );
                ____deploymentModPerThreatLevel.Clear();

                /*
                 * typeof( DynamicDifficultySystem ).GetMethod( "SetInitialDeploymentValues", NonPublic | Instance ).Invoke( __instance, new object[]{ mission.ThreatLevel } );
                 * Info( "After recalc: Min {0} Cur {1}",
                 * ____deploymentModPerThreatLevel[ mission.ThreatLevel ].MinDeploymentModifier,
                 * ____deploymentModPerThreatLevel[ mission.ThreatLevel ].CurrentDeploymentModifier
                 * );
                 */
            } catch (Exception ex) { Error(ex); }
        }