示例#1
0
    public override void Attack()
    {
        GameObject  go    = Instantiate(breathSkill, this.transform.position, this.transform.rotation);
        RangedSpell spell = go.GetComponent <RangedSpell>();

        spell.spellSpeed = 5;
        spell.damage     = damage;
        spell.target     = target;
    }
示例#2
0
    // Start is called before the first frame update
    void Start()
    {
        myCharRangedSpell = GameObject.FindGameObjectWithTag("Player").GetComponent <RangedSpell>();
        playerSpellBook   = GameObject.FindGameObjectWithTag("Player").GetComponent <SpellBook>();

        // key bindings for hotbar
        action1 = KeyCode.Alpha1;
        action2 = KeyCode.Alpha2;
        action3 = KeyCode.Alpha3;

        playerNamePortrait.SetText(myChar.entityName);

        hpText.SetText("{0}/{1}", myChar.getCurHP(), myChar.getMaxHP());
        manaText.SetText("{0}/{1}", myChar.getCurMana(), myChar.getMaxMana());
        xpText.SetText("{0}/{1}", charLevelSystem.getCurXP(), charLevelSystem.getMaxXP());

        charSheetNeedsUpdating = true;
    }
示例#3
0
    public void UsedSpell(int id)
    {
        //print(spellOnCD.Contains(id));
        if (spellOnCD.Contains(id) == false)
        {
            //print("Used spell 1");
            isCasting = true;
            //if (playerSpells[id].type == SpellType.Ranged)
            if (playerSpellBook.playerOwnedSpells[id].getSpellType() == SpellType.Ranged)
            {
                //currentSpellCasted = rangedSpellPrefab.GetComponent<RangedSpell>();
                currentSpellCasted               = playerSpellBook.playerOwnedSpells[id].getSpellPrefab().GetComponent <RangedSpell>();
                currentSpellCasted.castTime      = playerSpellBook.playerOwnedSpells[id].getSpellCastTime();
                currentSpellCasted.needPlayerDir = true;
                uiManager.CastingBar(id);
                RangedAttack(id);

                StartCoroutine(SpellOnCD(id));
            }
        }
    }