Skip to content

Commit

Permalink
Merge pull request #52 from BobPalmer/DEVELOP
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
BobPalmer committed Jan 21, 2016
2 parents bb2226f + c088add commit 016da07
Show file tree
Hide file tree
Showing 17 changed files with 123 additions and 9 deletions.
13 changes: 13 additions & 0 deletions FOR_RELEASE/GameData/000_USITools/Agency/USIAgency.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
AGENT
{
name = Umbra Space Industries

description = A world leader in corrugated paper products, Umbra Space Industries is now applying their formidable boxing and packaging skills into a a series of products for colonization, exploration, and resource exploitation!

logoURL = 000_USITools/Agency/USILogo
logoScaledURL = 000_USITools/Agency/USILogo_SM

mentality = Commercial
mentality = Economic 0.3
mentality = EasyGoing 0.25
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions FOR_RELEASE/GameData/000_USITools/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
0.5.5 - 2016.01.18
------------------
Inflatable fuel tank module
Tweaks to the pulse engine module
Bundled USI FX as part of USITools, as it is the best common denominator

0.5.4 - 2015.12.08
------------------
New modules for aquatic stuff (Ballast, RCS, SAS, engines, and Intake)

0.5.3 - 2015.11.09
------------------
KSP 1.0.5 Compatibility
New categories for rovers and MKS-Lite

0.5.2 - 2015.10.16
------------------
Moved out reactors and tanks to the USI_Core repo

0.5.1 - 2015.10.06
-------------------
Consolidated tanks and added alternate textures

0.5.0 - 2015.10.06
------------------
Merged nuke reactors and kontainers into the core USI mod
Increased LH2 amnount in all containers
Added containers for Karborundum, Xenon, and Argon
Increased nuke output and mass
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions FOR_RELEASE/GameData/000_USITools/Logistics.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
LOGISTICS_SETTINGS
{
ScavangeRange = 150
LogisticsTime = 5
WarehouseTime = 10
MaintenanceRange = 150
}
Binary file added FOR_RELEASE/GameData/000_USITools/USITools.dll
Binary file not shown.
31 changes: 31 additions & 0 deletions FOR_RELEASE/GameData/000_USITools/USITools.version
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"NAME":"USI Tools",
"URL":"https://raw.githubusercontent.com/BobPalmer/UmbraSpaceIndustries/master/FOR_RELEASE/GameData/UmbraSpaceIndustries/USICore.version",
"DOWNLOAD":"https://github.com/BobPalmer/UmbraSpaceIndustries/releases",
"GITHUB":{
"USERNAME":"BobPalmer",
"REPOSITORY":"UmbraSpaceIndustries",
"ALLOW_PRE_RELEASE":false
},
"VERSION":{
"MAJOR":0,
"MINOR":5,
"PATCH":5,
"BUILD":0
},
"KSP_VERSION":{
"MAJOR":1,
"MINOR":0,
"PATCH":5
},
"KSP_VERSION_MIN":{
"MAJOR":1,
"MINOR":0,
"PATCH":0
},
"KSP_VERSION_MAX":{
"MAJOR":1,
"MINOR":0,
"PATCH":5
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
0.3.2 - 2016.01.20
------------------
Fixed an issue where crew were being doubled when showing the supplies left in the UI
Updated a few issues where the Kerbal's supply counter was not updating properly
Wear is off by default, and when not enabled, will not show in the GUI

0.3.1 - 2016.01.19
------------------
Bundled USITools

0.3.0 - 2016.01.18
------------------
EVA timer is now based on how long the kerbal has been EVA.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"VERSION":{
"MAJOR":0,
"MINOR":3,
"PATCH":0,
"PATCH":2,
"BUILD":0
},
"KSP_VERSION":{
Expand Down
Binary file not shown.
Binary file not shown.
18 changes: 17 additions & 1 deletion Source/USILifeSupport/LifeSupportManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,26 @@ internal void UpdateVesselStats()
}
}

private static int GetColonyCrewCount(Vessel vsl)
{
var crewCount = vsl.GetCrewCount();
var vList = LogisticsTools.GetNearbyVessels((float)LifeSupportSetup.Instance.LSConfig.HabRange, false, vsl, true);
foreach (var v in vList)
{
crewCount += v.GetCrewCount();
}
return crewCount;
}

internal static double GetRecyclerMultiplier(Vessel vessel)
{
if (!LifeSupportSetup.Instance.LSConfig.EnableRecyclers)
return 1d;

var recyclerCap = 0f;
var recyclerVal = 1f;
var crewCount = vessel.GetCrewCount();
var crewCount = GetColonyCrewCount(vessel);

foreach (var r in vessel.FindPartModulesImplementing<ModuleLifeSupportRecycler>())
{
if (r.IsActivated)
Expand Down Expand Up @@ -310,6 +322,10 @@ internal static double GetRecyclerMultiplierForParts(List<Part> pList, int crewC

return Math.Max(recyclerVal, (1f - recyclerCap));
}
public static bool IsOnKerbin(Vessel v)
{
return (v.mainBody == FlightGlobals.GetHomeBody() && v.altitude < LifeSupportSetup.Instance.LSConfig.HomeWorldAltitude);
}
}
}

8 changes: 5 additions & 3 deletions Source/USILifeSupport/LifeSupportMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,11 @@ private void GenerateWindow()
var cls = LifeSupportManager.Instance.FetchKerbal(c);
cStat.CrewName = String.Format("<color=#FFFFFF>{0}</color>", c.name);

//var foodEaten = Planetarium.GetUniversalTime() - cls.LastMeal;
//var snacksLeft = vsl.SuppliesLeft - foodEaten;
var snacksLeft = supAmount/vsl.NumCrew/supPerDay*60*60*6;
var snacksLeft = supAmount / supPerDay * 60 * 60 * 6;
if (supAmount <= ResourceUtilities.FLOAT_TOLERANCE && !LifeSupportManager.IsOnKerbin(thisVessel))
{
snacksLeft = cls.LastMeal - Planetarium.GetUniversalTime();
}

var lblSup = "6FFF00";
if (snacksLeft < 60 * 60 * 6 * 15) //15 days
Expand Down
2 changes: 1 addition & 1 deletion Source/USILifeSupport/LifeSupportSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private LifeSupportConfig LoadLifeSupportConfig()
SupplyTime=324000,
SupplyAmount = 0.00005f,
WasteAmount = 0.00005f,
ReplacementPartAmount = 0.00001f,
ReplacementPartAmount = 0f,
EnableRecyclers = false,
HabRange = 2000
};
Expand Down
12 changes: 9 additions & 3 deletions Source/USILifeSupport/ModuleLifeSupport.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Linq;
using System.Resources;
using Random = System.Random;

namespace LifeSupport
Expand All @@ -18,6 +19,10 @@ public override void OnStart(StartState state)
LifeSupportManager.Instance.TrackVessel(v);
Fields["status"].guiActive = false;
IsActivated = true;
if (LifeSupportSetup.Instance.LSConfig.ReplacementPartAmount < ResourceUtilities.FLOAT_TOLERANCE)
{
Fields["wearPercent"].guiActive = false;
}
}
}

Expand Down Expand Up @@ -80,6 +85,8 @@ private void CheckForDeadKerbals()
}
}



protected override void PostProcess(ConverterResults result, double deltaTime)
{
var v = LifeSupportManager.Instance.FetchVessel(part.vessel.id.ToString());
Expand Down Expand Up @@ -140,10 +147,9 @@ protected override void PostProcess(ConverterResults result, double deltaTime)
//Fetch them from the queue
var k = LifeSupportManager.Instance.FetchKerbal(c);
//Update our stuff
var onKerbin = (part.vessel.mainBody == FlightGlobals.GetHomeBody() && part.vessel.altitude < LifeSupportSetup.Instance.LSConfig.HomeWorldAltitude);

//First - Hab effects.
if (onKerbin)
if (LifeSupportManager.IsOnKerbin(part.vessel))
{
k.LastOnKerbin = Planetarium.GetUniversalTime();
k.MaxOffKerbinTime = Planetarium.GetUniversalTime() + 972000000;
Expand All @@ -160,7 +166,7 @@ protected override void PostProcess(ConverterResults result, double deltaTime)
isGrouchyHab = CheckHabSideEffects(k, c, v);

//Second - Supply
if (!onKerbin && (deltaTime - result.TimeFactor > tolerance))
if (!LifeSupportManager.IsOnKerbin(part.vessel) && (deltaTime - result.TimeFactor > tolerance))
{
isGrouchySupplies = CheckSupplySideEffects(k, c);
}
Expand Down

0 comments on commit 016da07

Please sign in to comment.