// kill a kerbal public static void Kill(Vessel v, ProtoCrewMember c) { // forget kerbal data DB.ForgetKerbal(c.name); // if on pod if (!v.isEVA) { // if vessel is loaded if (v.loaded) { // find part Part part = null; foreach (Part p in v.parts) { if (p.protoModuleCrew.Find(k => k.name == c.name) != null) { part = p; break; } } // remove kerbal and kill it part.RemoveCrewmember(c); c.Die(); } // if vessel is not loaded else { // find proto part ProtoPartSnapshot part = null; foreach (ProtoPartSnapshot p in v.protoVessel.protoPartSnapshots) { if (p.HasCrew(c.name)) { part = p; break; } } // remove from vessel part.RemoveCrew(c.name); // flag as dead c.rosterStatus = ProtoCrewMember.RosterStatus.Dead; // register background death manually for death report notifications Notifications.RegisterDeath(); } } // else it must be an eva death else { // flag as eva death EVA.Kill(v); // rename vessel v.vesselName = c.name + "'s body"; // register eva death manually for death report notifications Notifications.RegisterDeath(); } // remove reputation if (HighLogic.CurrentGame.Mode == Game.Modes.CAREER) { Reputation.Instance.AddReputation(-Settings.DeathReputationPenalty, TransactionReasons.Any); } }