private static float CalculateCheckMod(Mech mech, float multi, bool gutsSkill) { int rawSkill = gutsSkill ? mech.SkillGuts : mech.SkillPiloting; int actorSkill = SkillUtils.NormalizeSkill(rawSkill); Mod.Log.Debug?.Write($"Actor: {CombatantUtils.Label(mech)} has rawSkill: {actorSkill} normalized to {actorSkill}"); int malus = 0; if (!gutsSkill) { // Piloting checks must use damage malus malus += mech.ActuatorDamageMalus(); } float adjustedSkill = actorSkill - malus > 0f ? actorSkill - malus : 0f; Mod.Log.Info?.Write($" AdjustedSkill: {adjustedSkill} = actorSkill: {actorSkill} - malus: {malus}."); float checkMod = adjustedSkill * multi; Mod.Log.Info?.Write($" CheckMod: {checkMod} = adjustedSkill: {adjustedSkill} * multi: {multi}"); return(checkMod); }