private void UpdateBases() { Debug.Log("Updating Bases"); Instance GameInstance = StateFundingGlobal.fetch.GameInstance; Vessel[] _Bases = VesselHelper.GetBases(); Bases = new BaseReport[_Bases.Length]; for (int i = 0; i < _Bases.Length; i++) { Vessel Base = _Bases [i]; BaseReport _BaseReport = new BaseReport(); _BaseReport.name = Base.vesselName; _BaseReport.crew = VesselHelper.GetCrew(Base).Length; _BaseReport.crewCapacity = VesselHelper.GetCrewCapactiy(Base); _BaseReport.dockedVessels = VesselHelper.GetDockedVesselsCount(Base); _BaseReport.dockingPorts = VesselHelper.GetDockingPorts(Base).Length; _BaseReport.drill = VesselHelper.VesselHasModuleAlias(Base, "Drill"); _BaseReport.scienceLab = VesselHelper.VesselHasModuleAlias(Base, "ScienceLab"); _BaseReport.fuel = VesselHelper.GetResourceCount(Base, "LiquidFuel"); _BaseReport.ore = VesselHelper.GetResourceCount(Base, "Ore"); _BaseReport.entity = Base.landedAt; _BaseReport.po = 0; _BaseReport.sc = 0; _BaseReport.po += (int)(5 * _BaseReport.crew * GameInstance.Gov.poModifier); _BaseReport.po += (int)(5 * _BaseReport.dockedVessels * GameInstance.Gov.poModifier); _BaseReport.po += (int)((BodyHelper.GetBody(Base.landedAt).Radius / 60000f) * (_BaseReport.dockedVessels + 1) * GameInstance.Gov.poModifier); _BaseReport.sc += (int)(2 * _BaseReport.crewCapacity * GameInstance.Gov.scModifier); _BaseReport.sc += (int)(_BaseReport.fuel / 200f * GameInstance.Gov.scModifier); _BaseReport.sc += (int)(_BaseReport.ore / 200f * GameInstance.Gov.scModifier); _BaseReport.sc += (int)(2 * _BaseReport.dockingPorts * GameInstance.Gov.scModifier); _BaseReport.sc += (int)(2 * _BaseReport.crewCapacity * GameInstance.Gov.scModifier); if (_BaseReport.scienceLab) { _BaseReport.po += (int)(10 * GameInstance.Gov.poModifier); _BaseReport.sc += (int)(10 * GameInstance.Gov.poModifier); } if (_BaseReport.drill) { _BaseReport.po += (int)(10 * GameInstance.Gov.poModifier); _BaseReport.sc += (int)(10 * GameInstance.Gov.poModifier); } Bases [i] = _BaseReport; } }
public static bool QualifiedStranded(ProtoCrewMember Kerb) { Vessel Vsl = GetVessel(Kerb); if (Vsl != null && Vsl.protoVessel.vesselType != VesselType.Base && Vsl.protoVessel.vesselType != VesselType.Rover && Vsl.protoVessel.vesselType != VesselType.Station) { if (!VesselHelper.HasLiquidFuel(Vsl) || !VesselHelper.HasEnergy(Vsl)) { if (!VesselHelper.VesselHasModuleAlias(Vsl, "ScienceLab")) { if (!VesselHelper.VesselHasModuleAlias(Vsl, "Drill")) { return(true); } } } } return(false); }
public static bool HasCommunication(Vessel Vsl) { return(VesselHelper.VesselHasModuleAlias(Vsl, "Communication")); }
public static bool GeneratesEnergy(Vessel Vsl) { return(VesselHelper.VesselHasModuleAlias(Vsl, "Energy")); }
private void UpdateSpaceStations() { Debug.Log("Updating Space Stations"); Instance GameInstance = StateFundingGlobal.fetch.GameInstance; Vessel[] SpcStations = VesselHelper.GetSpaceStations(); SpaceStations = new SpaceStationReport[SpcStations.Length]; for (int i = 0; i < SpcStations.Length; i++) { Vessel SpcStation = SpcStations [i]; SpaceStationReport SpcStationReport = new SpaceStationReport(); SpcStationReport.name = SpcStation.vesselName; SpcStationReport.crew = VesselHelper.GetCrew(SpcStation).Length; SpcStationReport.crewCapacity = VesselHelper.GetCrewCapactiy(SpcStation); SpcStationReport.dockedVessels = VesselHelper.GetDockedVesselsCount(SpcStation); SpcStationReport.dockingPorts = VesselHelper.GetDockingPorts(SpcStation).Length; SpcStationReport.drill = VesselHelper.VesselHasModuleAlias(SpcStation, "Drill"); SpcStationReport.scienceLab = VesselHelper.VesselHasModuleAlias(SpcStation, "ScienceLab"); SpcStationReport.fuel = VesselHelper.GetResourceCount(SpcStation, "LiquidFuel"); SpcStationReport.ore = VesselHelper.GetResourceCount(SpcStation, "Ore"); SpcStationReport.onAstroid = VesselHelper.OnAstroid(SpcStation); if (SpcStation.Landed) { SpcStationReport.entity = SpcStation.landedAt; } else { SpcStationReport.entity = SpcStation.GetOrbit().referenceBody.GetName(); } SpcStationReport.po = 0; SpcStationReport.sc = 0; SpcStationReport.po += (int)(5 * SpcStationReport.crew * GameInstance.Gov.poModifier); SpcStationReport.po += (int)(5 * SpcStationReport.dockedVessels * GameInstance.Gov.poModifier); if (SpcStationReport.onAstroid) { SpcStationReport.po += (int)(30 * GameInstance.Gov.poModifier); if (SpcStationReport.drill) { SpcStationReport.po += (int)(10 * GameInstance.Gov.poModifier); SpcStationReport.sc += (int)(10 * GameInstance.Gov.poModifier); } } SpcStationReport.sc += (int)(2 * SpcStationReport.crewCapacity * GameInstance.Gov.scModifier); SpcStationReport.sc += (int)(SpcStationReport.fuel / 200f * GameInstance.Gov.scModifier); SpcStationReport.sc += (int)(SpcStationReport.ore / 200f * GameInstance.Gov.scModifier); SpcStationReport.sc += (int)(2 * SpcStationReport.dockingPorts * GameInstance.Gov.scModifier); SpcStationReport.sc += (int)(2 * SpcStationReport.crewCapacity * GameInstance.Gov.scModifier); if (SpcStationReport.scienceLab) { SpcStationReport.po += (int)(10 * GameInstance.Gov.poModifier); SpcStationReport.sc += (int)(10 * GameInstance.Gov.poModifier); } SpaceStations [i] = SpcStationReport; } }