private static void AfterDefDeploy_BoostDef(GeoHavenDefenseMission __instance, ref int __result, GeoHaven haven) { try { if (haven == null) { return; } GeoFaction attacker = __instance.GetEnemyFaction() is GeoSubFaction sub ? attacker = sub.BaseFaction : __instance.GetEnemyFaction() as GeoFaction; var defender = haven.Site.Owner; Info("{0} of {1} under attack by {2}, defense strength {3}. Alert level {4}.", haven.Site.Name, defender, attacker.GetPPName(), __result, haven.AlertLevel); var conf = Config.Defense_Multiplier; float multiply = conf.Default; switch (haven?.AlertLevel) { case GeoHaven.HavenAlertLevel.Alert: multiply *= conf.Alert; break; case GeoHaven.HavenAlertLevel.HighAlert: multiply *= conf.High_Alert; break; } var geoLevel = haven.Site.GeoLevel; if (IsAlien(attacker)) { multiply *= conf.Attacker_Pandora; } else if (attacker == geoLevel.AnuFaction) { multiply *= conf.Attacker_Anu; } else if (attacker == geoLevel.SynedrionFaction) { multiply *= conf.Attacker_Synedrion; } else if (attacker == geoLevel.NewJerichoFaction) { multiply *= conf.Attacker_NewJericho; } if (IsAlien(defender)) { multiply *= conf.Defender_Pandora; } else if (defender == geoLevel.AnuFaction) { multiply *= conf.Defender_Anu; } else if (defender == geoLevel.SynedrionFaction) { multiply *= conf.Defender_Synedrion; } else if (defender == geoLevel.NewJerichoFaction) { multiply *= conf.Defender_NewJericho; } if (multiply != 1) { __result = (int)Math.Round(__result * multiply); Info("Multiplying defender strength by {0} to {1}", multiply, __result); } } catch (Exception ex) { Error(ex); } }
private static void AfterSetRecruitment_ListPerks(HavenFacilityItemController __instance, GeoHaven ____haven) { try { var recruit = ____haven?.AvailableRecruit; if (Config.Disable_Zone_Tooltip) { __instance.ZoneTooltip.Enabled = recruit == null; } if (recruit == null) { return; } //Api( "ui.dump", __instance ); Info("Showing info of {0}", recruit.GetName()); if (Config.Skills.Enabled) { ShowRecruitInfo(__instance, "PersonalSkills", new PersonalSkillInfo(recruit)); } if (Config.Augments.Enabled) { ShowRecruitInfo(__instance, "AugmentList", new AugInfo(recruit)); } if (Config.Equipments.Enabled) { ShowRecruitInfo(__instance, "EquipmentList", new EquipmentInfo(recruit)); } //ModnixApi?.Invoke( "zy.ui.dump", __instance.gameObject ); } catch (Exception ex) { Error(ex); } }