Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
XeoNovaDan
committed
Oct 18, 2018
1 parent
1582f5f
commit 2974f95
Showing
20 changed files
with
92 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<Manifest> | ||
<identifier>WatermillTweaks</identifier> | ||
<version>1.1.3</version> | ||
<version>1.2</version> | ||
<manifestUri>https://rawgit.com/XeoNovaDan/WatermillTweaks/master/About/Manifest.xml</manifestUri> | ||
<downloadUri>https://github.com/XeoNovaDan/WatermillTweaks/releases</downloadUri> | ||
</Manifest> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
Source/WatermillTweaks/.vs/WatermillTweaks/DesignTimeBuild/.dtbcache
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+568 KB
(160%)
Source/WatermillTweaks/.vs/WatermillTweaks/v15/Server/sqlite3/storage.ide
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Source/WatermillTweaks/.vs/WatermillTweaks/v15/Server/sqlite3/storage.ide-shm
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Source/WatermillTweaks/.vs/WatermillTweaks/v15/Server/sqlite3/storage.ide-wal
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using UnityEngine; | ||
using Verse; | ||
using RimWorld; | ||
|
||
namespace WatermillTweaks | ||
{ | ||
public static class WatermillUtility | ||
{ | ||
|
||
private const float PowerProductionFactorSpring = 1.2f; | ||
private const float PowerProductionFactorSummer = 1f; | ||
private const float PowerProductionFactorFall = 1.1f; | ||
private const float PowerProductionFactorWinter = 0.7f; | ||
|
||
//private const float ZeroPowerProductionLowTemp = -40f; | ||
//private const float HalfPowerProductionLowTemp = -10f; | ||
private const float FullPowerProductionLowTemp = 0f; | ||
private const float FullPowerProductionHighTemp = 50f; | ||
private const float HalfPowerProductionHighTemp = 60f; | ||
private const float ZeroPowerProductionHighTemp = 90f; | ||
|
||
public static Season GetMapSeason(this Thing thing) => | ||
GenDate.Season(Find.TickManager.TicksAbs, Find.WorldGrid.LongLatOf(thing.MapHeld.Tile)); | ||
|
||
public static RiverDef GetRiver(this Map map) => | ||
map.TileInfo.Rivers.First().river; | ||
|
||
public static float SeasonalPowerOutputFactorFor(Season season) | ||
{ | ||
switch (season) | ||
{ | ||
case (Season.PermanentWinter | Season.Winter): | ||
return PowerProductionFactorWinter; | ||
case Season.Fall: | ||
return PowerProductionFactorFall; | ||
case Season.Spring: | ||
return PowerProductionFactorSpring; | ||
default: | ||
return PowerProductionFactorSummer; | ||
} | ||
} | ||
|
||
public static SimpleCurve GetTemperatureToPowerOutputFactorCurveFor(Thing thing) | ||
{ | ||
RiverDef river = thing.Map.GetRiver(); | ||
float halfPowerProductionLowTemp = LowPowerProductionDict[river]; | ||
|
||
return new SimpleCurve() | ||
{ | ||
new CurvePoint(Mathf.RoundToInt(halfPowerProductionLowTemp * 1.5f), 0f), | ||
new CurvePoint(halfPowerProductionLowTemp, 0.5f), | ||
new CurvePoint(FullPowerProductionLowTemp, 1f), | ||
new CurvePoint(FullPowerProductionHighTemp, 1f), | ||
new CurvePoint(HalfPowerProductionHighTemp, 0.5f), | ||
new CurvePoint(ZeroPowerProductionHighTemp, 0f) | ||
}; | ||
} | ||
|
||
private static readonly Dictionary<RiverDef, float> LowPowerProductionDict = new Dictionary<RiverDef, float>() | ||
{ | ||
{ RiverDefOf.Creek, -5f }, | ||
{ RiverDefOf.River, -10f }, | ||
{ RiverDefOf.LargeRiver, -15f }, | ||
{ RiverDefOf.HugeRiver, -20f }, | ||
}; | ||
|
||
} | ||
} |
Binary file modified
BIN
-38 Bytes
(99%)
Source/WatermillTweaks/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
Source/WatermillTweaks/obj/Debug/WatermillTweaks.csproj.CoreCompileInputs.cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
f1f02df9e5eade6a376db0eff59e2e7a5162b966 | ||
d061d2c908a8112dc39d0b29286b427af139ea92 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+2.24 KB
(100%)
Source/WatermillTweaks/obj/Debug/WatermillTweaks.csprojAssemblyReference.cache
Binary file not shown.
Binary file not shown.