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 static void Prefix(MoveStatusPreview __instance, AbstractActor actor, Vector3 worldPos, MoveType moveType) { Mod.Log.Trace?.Write("MSP:DPS entered."); if (actor.CurrentPosition != worldPos) { float distance = Vector3.Distance(actor.CurrentPosition, worldPos); int steps = (int)Math.Ceiling(distance / 30f); Mod.Log.Trace?.Write($" position change for: ({CombatantUtils.Label(actor)}), moved {distance}m = {steps} steps"); actor.StatCollection.Set(ModStats.MimeticCurrentSteps, steps); } }