示例#1
0
    public void EldritchBlast()
    {
        EldritchBlast blast = Me.Actions.Magic.GetComponent <EldritchBlast>();

        if (blast == null)
        {
            return;
        }

        if (Me.Actions.CanTakeAction && BlastButton.interactable && Mouse.SelectedObjects != null)
        {
            var targets = Mouse.SelectedObjects.Where(so => so != null && Me.Actions.Combat.IsAttackable(so) && blast.IsWithinAttackRange(so.transform));
            if (targets.Any())
            {
                Actor actor = targets.First().GetComponent <Actor>();
                if (actor != null && blast.IsWithinAttackRange(actor.transform))
                {
                    blast.Cast(actor);
                    Me.Actions.CanTakeAction = false;
                }
            }
        }
    }
示例#2
0
    private void SpawnEldritchBlast()
    {
        Vector3 eldritchSpawnPos = new Vector3(transform.position.x + (.7f * transform.localScale.x), transform.position.y + 0.6f, transform.position.z);

        eldritchBlast = Instantiate(eldritchBlastPrefab, eldritchSpawnPos, transform.rotation);
    }