Пример #1
0
    public void SpawnSpellBook(SpellPrimary primary, Vector3 position)
    {
        SpellBook newSpellBook = Instantiate(spellBookPrefab, position, Quaternion.identity);

        newSpellBook.primaryEffect   = primary;
        newSpellBook.secondaryEffect = secondarySpellEffects[Random.Range(0, secondarySpellEffects.Count)];
    }
Пример #2
0
    public void SpawnSpellBook(SpellPrimary primary, SpellSecondary secondary, Vector3 position)
    {
        SpellBook newSpellBook = Instantiate(spellBookPrefab, position, Quaternion.identity);

        newSpellBook.primaryEffect   = primary;
        newSpellBook.secondaryEffect = secondary;
    }
Пример #3
0
    public void SpawnSpell(SpellPrimary primary, SpellSecondary secondary)
    {
        SpellBook newSpellBook = Instantiate(bookPrefab, spawnPoint.position, spawnPoint.rotation);

        newSpellBook.primaryEffect   = primary;
        newSpellBook.secondaryEffect = secondary;
    }
Пример #4
0
    public SpellBook GenerateSpell(SpellPrimary primary, SpellSecondary secondary, Vector3 position) // Generate spell given primary, secondary, and location
    {
        SpellBook newSpellBook = Instantiate(spellBookPrefab, position, Quaternion.identity);

        newSpellBook.primaryEffect   = primary;
        newSpellBook.secondaryEffect = secondary;
        return(newSpellBook);
    }
Пример #5
0
    public SpellBook GenerateSpell(SpellPrimary primary, Vector3 position) // Generate spell given spell primary and location
    {
        SpellBook newSpellBook = Instantiate(spellBookPrefab, position, Quaternion.identity);

        newSpellBook.primaryEffect   = primary;
        newSpellBook.secondaryEffect = secondarySpellEffects[Random.Range(0, secondarySpellEffects.Count)];
        return(newSpellBook);
    }
Пример #6
0
    public void SpawnSpell(SpellPrimary primary)
    {
        SpellBook newSpellBook = Instantiate(bookPrefab, spawnPoint.position, spawnPoint.rotation);

        newSpellBook.primaryEffect = primary;

        SpellSecondary newSecondary;

        if (OverrideSecondaryEffects.Count != 0)
        {
            newSecondary = OverrideSecondaryEffects[Random.Range(0, OverrideSecondaryEffects.Count)];
        }                                                                                                                                      // use this list if not empty
        else
        {
            newSecondary = SpellManager.Instance.secondarySpellEffects[Random.Range(0, SpellManager.Instance.secondarySpellEffects.Count)];
        }
        newSpellBook.secondaryEffect = newSecondary;
    }
    public override void setup(Movement owner)
    {
        startingState   = new WizardEnemyIdle();
        owner.baseSpeed = baseSpeed;
        owner.maxSpeed  = maxSpeed;
        Damageable ownerDam = owner.GetComponent <Damageable>();

        ownerDam.max_health = health;
        owner.damage        = damage;
        owner.attackTarget  = GameObject.FindGameObjectWithTag(attackTargetTag).transform;

        // Add spellbook to enemy's inventory
        if (SpellManager.Instance != null)   // if spell manager is running
        {
            SpellCaster spellCaster = owner.GetComponent <SpellCaster>();

            if (!spellCaster.returnSpell())
            {
                SpellPrimary   primary      = possibleSpellPrimaries[Random.Range(0, possibleSpellPrimaries.Length)];
                SpellSecondary secondary    = possibleSpellSecondaries[Random.Range(0, possibleSpellSecondaries.Length)];
                SpellBook      newSpellBook = SpellManager.Instance.GenerateSpell(primary, secondary, owner.transform.position); // Create a new spellbook

                newSpellBook.Interact(spellCaster);
                newSpellBook.SetupSpell();
            }
        }

        /*
         * SpellBook newSpellBook = Instantiate(spellBookPrefab, owner.transform.position, owner.transform.rotation);
         * newSpellBook.primaryEffect = possibleSpellPrimaries[Random.Range(0, possibleSpellPrimaries.Length)];
         * newSpellBook.secondaryEffect = possibleSpellSecondaries[Random.Range(0, possibleSpellSecondaries.Length)];
         *
         * // Have enemy pick up spellbook
         * SpellCaster spellCaster = owner.GetComponent<SpellCaster>();
         * newSpellBook.Interact(spellCaster);
         */

        base.setup(owner);
    }