Aetheria/Assets/Scripts/ServerShared/OrbitalEntity.cs
Meta Vens be7f2b0787 Layers: one owner puts orbitals above the ship plane and floaters below; per-hull GridOffset is deleted
GameplaySettings carries ShipLayerHeight 3, OrbitalLayerHeight 15, FloaterLayerHeight 0 (authored in Settings.asset).
Entity.LayerHeight (Ship, OrbitalEntity) is the one offset RideHeight adds; DrawAhead.FloaterHeight is the floater
height ItemPickup and MineInstance draw at. HullData.GridOffset (Key 26) and the pickup/mine/prefab GridOffset fields
are gone with every reader. Fixtures (DrawnPose, FireControl*, ImpactFeedback) take heights from the layer owner;
LayerTests pin each kind's layer. FloatingItemsDrawnSmoke follows. ItemPickup/MineInstance.Bind take the settings from
ZoneRenderer. Builds as one commit with its tests; not compile-verified until the cut's head run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 02:35:07 +02:00

48 lines
1.4 KiB
C#

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using GameCult.Caching;
using CultMath;
using static CultMath.math;
using float2 = CultMath.float2;
public class OrbitalEntity : Entity
{
public CultRecordKey OrbitData;
public SecurityLevel SecurityLevel;
public float SecurityRadius;
public LocationStory Story;
public bool CanTow;
public OrbitalEntity(ItemManager itemManager, Zone zone, EquippableItem hull, CultRecordKey orbit, EntitySettings settings) : base(itemManager, zone, hull, settings)
{
OrbitData = orbit;
}
public override float LayerHeight => ItemManager.GameplaySettings.OrbitalLayerHeight;
public override void Update(float delta)
{
if (OrbitData.IsSet())
{
Position.xz = Zone.GetOrbitPosition(OrbitData);
Velocity = Zone.GetOrbitVelocity(OrbitData);
}
base.Update(delta);
}
public bool IsSecureArea
{
get
{
if (SecurityRadius < 1) return false;
if (Faction == null) return false;
return !IsPresencePermitted(Zone.Galaxy.FactionRelationships[Faction], SecurityLevel);
}
}
}