Example #1
0
 internal void SendObeliskBroken(IWorldClient client, Obelisk obelisk)
 {
     using var packet = new Packet(PacketType.OBELISK_CHANGE);
     packet.Write(obelisk.Id);
     packet.Write((byte)obelisk.ObeliskCountry);
     client.SendPacket(packet);
 }
Example #2
0
 public ObeliskUnit(Obelisk obelisk)
 {
     Id             = obelisk.Id;
     ObeliskCountry = obelisk.ObeliskCountry;
     X = obelisk.PosX;
     Z = obelisk.PosZ;
 }
Example #3
0
    public void OnEnter()
    {
        var selectedTarget = obeliskSelector.GetTarget().GetComponent <Obelisk>();

        timer        = buildTime;
        cachedTarget = selectedTarget;
        Finished     = false;
    }
Example #4
0
    public void OnExit()
    {
        if (currentInstance == null)
        {
            return;
        }

        Object.Destroy(currentInstance.gameObject);
        currentInstance = null;
    }
Example #5
0
    private bool CheckCanExtract()
    {
        var currentTarget = infusedObeliskSelector.GetTarget();

        if (currentTarget == null)
        {
            return(false);
        }
        cachedTarget = currentTarget.GetComponent <Obelisk>();
        return(cachedTarget != null);
    }
Example #6
0
        public ObeliskWithActiveState(Obelisk obelisk)
        {
            Id             = obelisk.Id;
            CodexdataId    = obelisk.CodexdataId;
            IsBroken       = obelisk.IsBroken;
            Number         = obelisk.Number;
            ObeliskgroupId = obelisk.ObeliskgroupId;
            Created        = obelisk.Created;
            Updated        = obelisk.Updated;

            Codexdata    = obelisk.Codexdata;
            Obeliskgroup = obelisk.Obeliskgroup;
        }
Example #7
0
    // Check if the needed content files have been patched.
    private static bool IsContentPresent(Obelisk o)
    {
        Dictionary <string, string> blueprintDict = Game1.content.Load <Dictionary <string, string> >(PathUtilities.NormalizePath("Data/Blueprints"));

        if (!blueprintDict.ContainsKey(o.InternalName))
        {
            Monitor1.Log($"{o.InternalName}: Content not present.");
            return(false);
        }

        var texture = Game1.content.Load <Texture2D>(PathUtilities.NormalizePath("Buildings/" + o.InternalName));

        Monitor1.Log($"{o.InternalName}: Content is present. Content == null = {texture == null}.");
        return(texture != null);
    }
Example #8
0
    void OnCollisionEnter(Collision collision)
    {
        if (collision.relativeVelocity.magnitude > minMagToTrigger)
        {
            triggered = true;

            if (collision.collider.gameObject.name == "NearestObelisk")
            {
                Animator anim = intelligentSphere.GetComponent <Animator>();
                anim.SetTrigger("ApproachPlayer");

                Obelisk ob = collision.collider.gameObject.GetComponent <Obelisk>();
                ob.IveBeenHit();
            }
        }
    }
Example #9
0
    //When enemies' hitboxes collide with undestroyed defences, set it as their target
    private void OnTriggerEnter(Collider col)
    {
        if (col.CompareTag("Defence"))
        {
            Obelisk obelisk = col.gameObject.GetComponent <Obelisk>();
            if (obelisk != null && obelisk.IsAlive)
            {
                Target = obelisk;
                return;
            }

            ForceField forceField = col.gameObject.GetComponent <ForceField>();
            if (forceField != null && forceField.IsAlive)
            {
                Target = forceField;
                return;
            }
        }
    }
Example #10
0
    public void Tick()
    {
        if (currentInstance == null ||
            player.ColliderTracker == null ||
            player.ColliderTracker.ClosestCollider == null)
        {
            return;
        }

        var obeliskPosition = PlayerInput.Instance.MouseRayHitPoint;
        var obeliskRotation = player.ColliderTracker.ClosestCollider.transform.forward;

        currentInstance.UpdatePosition(obeliskPosition, obeliskRotation);

        if (PlayerInput.Instance.PrimaryActionKeyDown && currentInstance.HasCorrectCollision)
        {
            currentInstance.Activate(player.ColliderTracker.ClosestCollider);
            currentInstance = null;
            Finished        = true;
        }
    }
Example #11
0
 public void SendObeliskBroken(Obelisk obelisk) => _packetsHelper.SendObeliskBroken(Client, obelisk);
Example #12
0
 public void OnEnter()
 {
     currentInstance = Object.Instantiate(prefab, new Vector3(0, -100, 0), Quaternion.identity);
     Finished        = false;
 }
Example #13
0
 public PlacingObelisk(Obelisk prefab, Player player)
 {
     this.prefab = prefab;
     this.player = player;
 }
 public void SendObeliskBroken(Obelisk obelisk) => _packetFactory.SendObeliskBroken(GameSession.Client, obelisk);