Exemplo n.º 1
0
        internal void OnCrewBoardVessel(GameEvents.FromToAction <Part, Part> data)
        {
            LaunchCrewEvent crewLaunch      = GetKerbalLaunch(data.from.vessel.vesselName);
            EvaCrewEndEvent evaCrewEndEvent = new EvaCrewEndEvent();

            crewLaunch.AddEvent(evaCrewEndEvent);
        }
Exemplo n.º 2
0
        public void RecordMaxGee()
        {
            if (FlightGlobals.ActiveVessel == null)
            {
                return;
            }
            LaunchEvent activeLaunch = GetLaunch(FlightGlobals.ActiveVessel);

            if (activeLaunch != null)
            {
                MaxGeeEvent maxGeeEv = new MaxGeeEvent();
                maxGeeEv.gee = activeLaunch.maxGee;
                if (activeLaunch.maxGee > activeLaunch.GetEventMaxGee())
                {
                    activeLaunch.AddEvent(maxGeeEv);
                }

                foreach (ProtoCrewMember kerbal in FlightGlobals.ActiveVessel.GetVesselCrew())
                {
                    LaunchCrewEvent crewLaunch = GetKerbalLaunch(kerbal.name);
                    if (crewLaunch.maxGee < activeLaunch.maxGee)
                    {
                        MaxGeeCrewEvent geeEv = new MaxGeeCrewEvent();
                        geeEv.gee = activeLaunch.maxGee;
                        if (crewLaunch.GetEventMaxGee() < activeLaunch.maxGee)
                        {
                            crewLaunch.AddEvent(geeEv);
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        internal void OnCrewKilled(EventReport data)
        {
            string          kerbalName = data.sender;
            DeathCrewEvent  death      = new DeathCrewEvent();
            LaunchCrewEvent kerbal     = GetKerbalLaunch(kerbalName);

            if (kerbal != null)
            {
                kerbal.AddEvent(death);
            }
        }
Exemplo n.º 4
0
 private void RecordCrewDockingEvent(Vessel from, Vessel to)
 {
     foreach (ProtoCrewMember kerbal in from.GetVesselCrew())
     {
         DockingCrewEvent landingCrewEvent = new DockingCrewEvent();
         LaunchCrewEvent  crewLaunch       = GetKerbalLaunch(kerbal.name);
         crewLaunch.AddEvent(landingCrewEvent);
     }
     foreach (ProtoCrewMember kerbal in to.GetVesselCrew())
     {
         DockingCrewEvent landingCrewEvent = new DockingCrewEvent();
         LaunchCrewEvent  crewLaunch       = GetKerbalLaunch(kerbal.name);
         crewLaunch.AddEvent(landingCrewEvent);
     }
 }
Exemplo n.º 5
0
        internal void OnCrewOnEva(GameEvents.FromToAction <Part, Part> data)
        {
            if (VesselType.EVA != data.to.vessel.vesselType)
            {
                return;
            }
            LaunchCrewEvent crewLaunch   = GetKerbalLaunch(data.to.vessel.vesselName);
            EvaCrewEvent    evaCrewEvent = new EvaCrewEvent();

            crewLaunch.AddEvent(evaCrewEvent);

            LaunchEvent launch = GetLaunch(data.from.vessel);

            if (launch != null)
            {
                EvaEvent evaEvent = new EvaEvent();
                launch.AddEvent(evaEvent);
            }
        }
Exemplo n.º 6
0
        private void RecordCrewLaunch(Vessel vessel)
        {
            long currentLaunchTime = GetTimeInTicks();

            foreach (ProtoCrewMember kerbal in vessel.GetVesselCrew())
            {
                LaunchCrewEvent crewSubLaunch = new LaunchCrewEvent();
                crewSubLaunch.name       = kerbal.name;
                crewSubLaunch.time       = currentLaunchTime;
                crewSubLaunch.vesselName = vessel.vesselName;

                LaunchCrewEvent crewLaunch = GetKerbalLaunch(kerbal.name);
                if (crewLaunch == null)
                {
                    crewLaunches.Add(crewSubLaunch);
                }
                else
                {
                    crewLaunch.AddEvent(crewSubLaunch);
                }
            }
        }
Exemplo n.º 7
0
        public void RecordLanding(Vessel vessel)
        {
            if (vessel.isEVA)
            {
                return;
            }
            LandingEvent landing = new LandingEvent();

            landing.mainBodyName = vessel.mainBody.name;
            landing.biome        = getBiomeName(vessel.mainBody, vessel.longitude, vessel.latitude);
            LaunchEvent launch = GetLaunch(vessel);

            if (launch != null)
            {
                FlightEvent flightEvent = launch.GetLastEvent();
                if (flightEvent is EvaEvent && (landing.time - flightEvent.time) / TimeSpan.TicksPerSecond < 1)
                {
                    return;
                }
                if (flightEvent is LandingEvent)
                {
                    if (((landing.time - flightEvent.time) / TimeSpan.TicksPerSecond < 2))
                    {
                        return;
                    }
                }
                launch.AddEvent(landing);
            }


            foreach (ProtoCrewMember kerbal in vessel.GetVesselCrew())
            {
                LandingCrewEvent landingCrewEvent = new LandingCrewEvent();
                LaunchCrewEvent  crewLaunch       = GetKerbalLaunch(kerbal.name);
                crewLaunch.AddEvent(landingCrewEvent);
            }
        }