public static void AppendDangerousTerrainText(MoveStatusPreview __instance, AbstractActor actor, Vector3 worldPos) { try { MapTerrainDataCell cell = Combat.EncounterLayerData.GetCellAt(worldPos).relatedTerrainCell; bool isLandingZone = SplatMapInfo.IsDropshipLandingZone(cell.terrainMask), isDangerous = SplatMapInfo.IsDangerousLocation(cell.terrainMask); if (!isLandingZone && !isDangerous) { return; } DesignMaskDef mask = Combat.MapMetaData.GetPriorityDesignMask(cell); if (mask == null) { return; } string title = mask.Description.Name, text = mask.Description.Details; CombatUIConstantsDef desc = Combat.Constants.CombatUIConstants; if (isDangerous) { title += " <#FF0000>(" + desc.DangerousLocationDesc.Name + ")"; text += " <#FF0000>" + desc.DangerousLocationDesc.Details; if (isLandingZone) { text += " " + desc.DrophipLocationDesc.Details; } } else { title += " <#FF0000>(" + desc.DrophipLocationDesc.Name + ")"; text += " <#FF0000>" + desc.DrophipLocationDesc.Details; } CombatHUDInfoSidePanel sidePanel = (CombatHUDInfoSidePanel)SidePanelProp?.GetValue(__instance, null); sidePanel?.ForceShowSingleFrame(new Text(title), new Text(text), null, false); } catch (Exception ex) { Error(ex); } }
public override void CombatStarts() { if (Settings.MovementPreviewRadius > 0) { MovementConstants con = CombatConstants.MoveConstants; con.ExperimentalHexRadius = Settings.MovementPreviewRadius; typeof(CombatGameConstants).GetProperty("MoveConstants").SetValue(CombatConstants, con, null); } if (Settings.FunctionKeySelectPC) { Combat.MessageCenter.AddSubscriber(MessageCenterMessageType.KeyPressedMessage, KeyPressed); } if (Settings.ConsolidateWeaponCheevons) { // If we want to consolidate weapon damage, need to overwrite CombatHUDWeaponTickMarks.UpdateTicksShown to not depends on GetValidSlots CombatUIConstantsDef uiConst = CombatConstants.CombatUIConstants; uiConst.collapseWeaponTypesInTickMarks = true; typeof(CombatGameConstants).GetProperty("CombatUIConstants").SetValue(CombatConstants, uiConst, null); } }