2020-12-22 03:13:43 +00:00
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
2020-04-16 03:08:18 +01:00
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
|
|
public class OrbitalEntity : Entity
|
|
|
|
|
|
{
|
2026-06-16 16:07:20 +01:00
|
|
|
|
public string OrbitKey = "";
|
2021-05-02 20:59:45 +01:00
|
|
|
|
public SecurityLevel SecurityLevel;
|
|
|
|
|
|
public float SecurityRadius;
|
2021-05-16 05:24:51 +01:00
|
|
|
|
public LocationStory Story;
|
2021-06-18 12:32:03 +01:00
|
|
|
|
public bool CanTow;
|
2020-04-16 03:08:18 +01:00
|
|
|
|
|
2026-06-16 16:07:20 +01:00
|
|
|
|
public OrbitalEntity(ItemManager itemManager, Zone zone, EquippableItem hull, string orbitKey, EntitySettings settings) : base(itemManager, zone, hull, settings)
|
2020-04-16 03:08:18 +01:00
|
|
|
|
{
|
2026-06-16 16:07:20 +01:00
|
|
|
|
OrbitKey = orbitKey ?? "";
|
2020-04-16 03:08:18 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void Update(float delta)
|
|
|
|
|
|
{
|
2026-06-16 16:07:20 +01:00
|
|
|
|
if (!string.IsNullOrWhiteSpace(OrbitKey))
|
2020-05-10 00:16:33 +01:00
|
|
|
|
{
|
2026-06-21 09:37:54 +01:00
|
|
|
|
CultPositionXZ = AetheriaMath.ToCult(Zone.GetOrbitPosition(OrbitKey));
|
|
|
|
|
|
CultVelocity = AetheriaMath.ToCult(Zone.GetOrbitVelocity(OrbitKey));
|
2020-05-10 00:16:33 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-16 03:08:18 +01:00
|
|
|
|
base.Update(delta);
|
|
|
|
|
|
}
|
2021-05-11 04:45:42 +01:00
|
|
|
|
|
|
|
|
|
|
public bool IsSecureArea
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
if (SecurityRadius < 1) return false;
|
|
|
|
|
|
if (Faction == null) return false;
|
2021-05-14 03:03:28 +01:00
|
|
|
|
return !IsPresencePermitted(Zone.Galaxy.FactionRelationships[Faction], SecurityLevel);
|
2021-05-11 04:45:42 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-04-16 03:08:18 +01:00
|
|
|
|
}
|