Exemple #1
0
        private void onCrewBoardVessel(GameEvents.FromToAction <Part, Part> data)
        {
            Part evaKerbal   = data.from;
            Part boardedPart = data.to;

            if (!string.IsNullOrEmpty(disqualifiedPreconditions) && boardedPart == this.part)
            {
                ProtoCrewMember astronaut     = evaKerbal.vessel.GetVesselCrew()[0];
                AstronautData   astronautData = SnacksScenario.Instance.GetAstronautData(astronaut);

                //Set disqualifier
                astronautData.SetDisqualifier(disqualifiedPreconditions);
            }
        }
Exemple #2
0
        private void onCrewTransferred(GameEvents.HostedFromToAction <ProtoCrewMember, Part> data)
        {
            ProtoCrewMember astronaut = data.host;
            Part            fromPart  = data.from;
            Part            toPart    = data.to;

            if (!string.IsNullOrEmpty(disqualifiedPreconditions) && toPart == this.part)
            {
                AstronautData astronautData = SnacksScenario.Instance.GetAstronautData(astronaut);

                //Set disqualifier
                astronautData.SetDisqualifier(disqualifiedPreconditions);
            }
        }
Exemple #3
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);
            GameEvents.onCrewOnEva.Add(onCrewOnEva);
            GameEvents.onCrewBoardVessel.Add(onCrewBoardVessel);
            GameEvents.onCrewTransferred.Add(onCrewTransferred);
            GameEvents.OnVesselRecoveryRequested.Add(OnVesselRecoveryRequested);

            //Set disqualifier
            ProtoCrewMember[] astronauts = this.part.protoModuleCrew.ToArray();
            for (int index = 0; index < astronauts.Length; index++)
            {
                AstronautData astronautData = SnacksScenario.Instance.GetAstronautData(astronauts[index]);
                astronautData.SetDisqualifier(disqualifiedPreconditions);
            }
        }