Make IsDayNow method and return silva photosynthesis (#1648)
* Make is day method and return silva photosynthesis * Disable CP14MagicEnergyDraw
This commit is contained in:
@@ -87,6 +87,12 @@ public sealed class CP14DayCycleSystem : EntitySystem
|
||||
return (float)lightLevel;
|
||||
}
|
||||
|
||||
public bool IsDayNow(Entity<LightCycleComponent?> map)
|
||||
{
|
||||
var lightLevel = GetLightLevel(map);
|
||||
return lightLevel >= 0.5;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks to see if the specified entity is on the map where it's daytime.
|
||||
/// </summary>
|
||||
@@ -101,7 +107,7 @@ public sealed class CP14DayCycleSystem : EntitySystem
|
||||
if (xform.MapUid is null || xform.GridUid is null)
|
||||
return false;
|
||||
|
||||
var day = GetLightLevel(xform.MapUid.Value) > 0.5f;
|
||||
var day = IsDayNow(xform.MapUid.Value);
|
||||
|
||||
var grid = xform.GridUid;
|
||||
if (grid is null)
|
||||
|
||||
@@ -18,8 +18,8 @@ public sealed partial class CP14IsNight : RulesRule
|
||||
if (map is null)
|
||||
return false;
|
||||
|
||||
var lightLevel = dayCycle.GetLightLevel(map.Value);
|
||||
var isDay = dayCycle.IsDayNow(map.Value);
|
||||
|
||||
return Inverted ? lightLevel < 0.5 : lightLevel >= 0.5;
|
||||
return Inverted ? !isDay : isDay;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
- HealingT1
|
||||
- HealingT2
|
||||
- type: CP14MagicEnergyPhotosynthesis # Silva special feature #Disabled until sunlight fixed
|
||||
- type: CP14MagicEnergyDraw #Enabled default mana regen until sunlight fixed
|
||||
- type: CP14MagicEnergyDraw
|
||||
enable: false
|
||||
- type: Body
|
||||
prototype: CP14Silva
|
||||
|
||||
Reference in New Issue
Block a user