示例#1
0
    public void LoadSpell(string sName, UB_SpellDetail sp, int lvl)
    {
        this.baseSpell = sp;
        this.spell     = new UB_Spell()
        {
            SpellName     = sName,
            Description   = sp.Description,
            Icon          = sp.Icon,
            Dmg           = sp.BaseDmg,
            Level         = 0,
            UpgradeLevels = sp.UpgradeLevels,
            FX            = sp.FX,
            Cooldown      = sp.Cooldown,
            LevelReq      = sp.LevelReq,
            ApplyStatus   = sp.ApplyStatus
        };

        this.SpellIcon.overrideSprite = GameController.Instance.iconManager.GetIconById(sp.Icon);

        if (lvl > 0)
        {
            UpgradeSpell(lvl);
        }
        spellUpgradeBar.LoadBar(lvl, sp.UpgradeLevels);

        if (PF_PlayerData.activeCharacter.characterData.CharacterLevel < this.spell.LevelReq)
        {
            this.unlockedLevel.text = "Unlocked at level: " + this.spell.LevelReq;
            this.lockedIcon.gameObject.SetActive(true);
            this.lockedMessage.gameObject.SetActive(true);
            this.UpgradeButton.interactable = false;
        }
        else
        {
            this.lockedIcon.gameObject.SetActive(false);
            this.lockedMessage.gameObject.SetActive(false);
            this.UpgradeButton.interactable = true;
        }

        this.SpellName.text     = this.spell.SpellName;
        this.Damage.text        = "" + this.spell.Dmg;
        this.UpgradeDamage.text = "" + Mathf.CeilToInt((1f + this.baseSpell.UpgradePower) * (float)this.spell.Dmg);
    }
示例#2
0
    public void AddSpellData(string spName, UB_SpellDetail sp, int spLvl)
    {
        if (sp == null)
        {
            return;
        }

        this.baseSpell = sp;
        this.SpellData = new UB_Spell()
        {
            SpellName     = spName,
            Description   = sp.Description,
            Icon          = sp.Icon,
            Dmg           = sp.BaseDmg,
            Level         = 0,
            UpgradeLevels = sp.UpgradeLevels,
            FX            = sp.FX,
            Cooldown      = sp.Cooldown,
            LevelReq      = sp.LevelReq,
            ApplyStatus   = sp.ApplyStatus
        };

        this.SpellIcon.overrideSprite = GameController.Instance.iconManager.GetIconById(sp.Icon);

        if (spLvl > 0)
        {
            UpgradeSpell(spLvl);
        }

        if (PF_PlayerData.activeCharacter.characterData.CharacterLevel < this.SpellData.LevelReq)
        {
            this.DisableCD();
            this.Lock();
        }
        else
        {
            this.Unlock();
            this.DisableCD();
        }
    }
示例#3
0
//	public void LoadSpell(UB_SavedCharacter saved)
//	{
//
//	}
//

    public void LoadSpell(string sName, UB_SpellDetail sp, int lvl)
    {
        this.baseSpell = sp;
        this.spell     = new UB_Spell()
        {
            SpellName     = sName,
            Description   = sp.Description,
            Icon          = sp.Icon,
            Dmg           = sp.BaseDmg,
            Level         = 0,
            UpgradeLevels = sp.UpgradeLevels,
            FX            = sp.FX,
            Cooldown      = sp.Cooldown,
            LevelReq      = sp.LevelReq,
            ApplyStatus   = sp.ApplyStatus
        };

        this.spellIcon.overrideSprite = GameController.Instance.iconManager.GetIconById(sp.Icon, IconManager.IconTypes.Spell);

        if (lvl > 0)
        {
            UpgradeSpell(lvl);
        }
        spellUpgradeBar.LoadBar(lvl, sp.UpgradeLevels);

        if (PF_PlayerData.activeCharacter.characterData.CharacterLevel < this.spell.LevelReq)
        {
            this.lockedIcon.gameObject.SetActive(true);
            this.lockedIcon.GetComponentInChildren <Text>().text = "Unlocks at " + this.spell.LevelReq;
        }
        else
        {
            this.lockedIcon.gameObject.SetActive(false);
        }

        this.spellName.text   = this.spell.SpellName;
        this.damageValue.text = "+" + this.spell.Dmg + " DMG";
    }