Make IsDayNow method and return silva photosynthesis (#1648)

* Make is day method and return silva photosynthesis

* Disable CP14MagicEnergyDraw
This commit is contained in:
Morb
2025-08-21 15:28:10 -07:00
committed by GitHub
parent 4a5bc15bd8
commit 42afa7b754
3 changed files with 10 additions and 4 deletions

View File

@@ -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)

View File

@@ -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;
}
}

View File

@@ -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