Exemplo n.º 1
0
    void SettingEquipmentStatus()
    {
        ItemDataC dataItem = database.GetComponent <ItemDataC>();
        StatusC   stat     = GetComponent <StatusC>();

        //Reset Power of Current Weapon & Armor
        //Set New Variable of Weapon
        stat.weaponAtk  = dataItem.equipment[weaponEquip].attack;
        stat.addDef     = dataItem.equipment[weaponEquip].defense;
        stat.weaponMatk = dataItem.equipment[weaponEquip].magicAttack;
        stat.addMdef    = dataItem.equipment[weaponEquip].magicDefense;
        stat.addHP      = dataItem.equipment[weaponEquip].hpBonus;
        stat.addMP      = dataItem.equipment[weaponEquip].mpBonus;
        //Set New Variable of Armor
        stat.weaponAtk  += dataItem.equipment[armorEquip].attack;
        stat.addDef     += dataItem.equipment[armorEquip].defense;
        stat.weaponMatk += dataItem.equipment[armorEquip].magicAttack;
        stat.addMdef    += dataItem.equipment[armorEquip].magicDefense;
        stat.addHP      += dataItem.equipment[armorEquip].hpBonus;
        stat.addMP      += dataItem.equipment[armorEquip].mpBonus;
        //Set New Variable of Accessory
        stat.weaponAtk  += dataItem.equipment[accessoryEquip].attack;
        stat.addDef     += dataItem.equipment[accessoryEquip].defense;
        stat.weaponMatk += dataItem.equipment[accessoryEquip].magicAttack;
        stat.addMdef    += dataItem.equipment[accessoryEquip].magicDefense;
        stat.addHP      += dataItem.equipment[accessoryEquip].hpBonus;
        stat.addMP      += dataItem.equipment[accessoryEquip].mpBonus;
        //Status Resist
        stat.eqResist.poisonResist  = dataItem.equipment[weaponEquip].statusResist.poisonResist + dataItem.equipment[armorEquip].statusResist.poisonResist + dataItem.equipment[accessoryEquip].statusResist.poisonResist;
        stat.eqResist.stunResist    = dataItem.equipment[weaponEquip].statusResist.stunResist + dataItem.equipment[armorEquip].statusResist.stunResist + dataItem.equipment[accessoryEquip].statusResist.stunResist;
        stat.eqResist.silenceResist = dataItem.equipment[weaponEquip].statusResist.silenceResist + dataItem.equipment[armorEquip].statusResist.silenceResist + dataItem.equipment[accessoryEquip].statusResist.silenceResist;
        stat.eqResist.webResist     = dataItem.equipment[weaponEquip].statusResist.webResist + dataItem.equipment[armorEquip].statusResist.webResist + dataItem.equipment[accessoryEquip].statusResist.webResist;

        stat.hiddenStatus.doubleJump = false;
        if (dataItem.equipment[weaponEquip].canDoubleJump)
        {
            stat.hiddenStatus.doubleJump = true;
        }
        if (dataItem.equipment[armorEquip].canDoubleJump)
        {
            stat.hiddenStatus.doubleJump = true;
        }
        if (dataItem.equipment[accessoryEquip].canDoubleJump)
        {
            stat.hiddenStatus.doubleJump = true;
        }
        stat.hiddenStatus.autoGuard  = dataItem.equipment[weaponEquip].autoGuard + dataItem.equipment[armorEquip].autoGuard + dataItem.equipment[accessoryEquip].autoGuard;
        stat.hiddenStatus.drainTouch = dataItem.equipment[weaponEquip].drainTouch + dataItem.equipment[armorEquip].drainTouch + dataItem.equipment[accessoryEquip].drainTouch;
        stat.hiddenStatus.mpReduce   = dataItem.equipment[weaponEquip].mpReduce + dataItem.equipment[armorEquip].mpReduce + dataItem.equipment[accessoryEquip].mpReduce;

        stat.CalculateStatus();
    }
Exemplo n.º 2
0
    public void UpgradeStatus(int statusId)
    {
        //0 = Atk , 1 = Def , 2 = Matk , 3 = Mdef
        if (!player)
        {
            return;
        }
        StatusC stat = player.GetComponent <StatusC>();

        if (statusId == 0 && stat.statusPoint > 0)
        {
            stat.atk         += 1;
            stat.statusPoint -= 1;
            stat.CalculateStatus();
        }
        if (statusId == 1 && stat.statusPoint > 0)
        {
            stat.def         += 1;
            stat.maxHealth   += 5;
            stat.statusPoint -= 1;
            stat.CalculateStatus();
        }
        if (statusId == 2 && stat.statusPoint > 0)
        {
            stat.matk        += 1;
            stat.maxMana     += 3;
            stat.statusPoint -= 1;
            stat.CalculateStatus();
        }
        if (statusId == 3 && stat.statusPoint > 0)
        {
            stat.mdef        += 1;
            stat.statusPoint -= 1;
            stat.CalculateStatus();
        }
    }
Exemplo n.º 3
0
    public void CalculateStatLv()
    {
        StatusC stat = GetComponent <StatusC>();

        currentLv = stat.level;
        //[min_stat*(max_lv-lv)/(max_lv- 1)] + [max_stat*(lv- 1)/(max_lv- 1)]

        //Atk
        min      = minStatus.atk * (maxLevel - currentLv) / (maxLevel - 1);
        max      = maxStatus.atk * (currentLv - 1) / (maxLevel - 1);
        stat.atk = min + max;
        //Def
        min      = minStatus.def * (maxLevel - currentLv) / (maxLevel - 1);
        max      = maxStatus.def * (currentLv - 1) / (maxLevel - 1);
        stat.def = min + max;
        //Matk
        min       = minStatus.matk * (maxLevel - currentLv) / (maxLevel - 1);
        max       = maxStatus.matk * (currentLv - 1) / (maxLevel - 1);
        stat.matk = min + max;
        //Mdef
        min       = minStatus.mdef * (maxLevel - currentLv) / (maxLevel - 1);
        max       = maxStatus.mdef * (currentLv - 1) / (maxLevel - 1);
        stat.mdef = min + max;

        //HP
        min            = minStatus.maxHealth * (maxLevel - currentLv) / (maxLevel - 1);
        max            = maxStatus.maxHealth * (currentLv - 1) / (maxLevel - 1);
        stat.maxHealth = min + max;
        stat.health    = stat.maxHealth;
        //MP
        min          = minStatus.maxMana * (maxLevel - currentLv) / (maxLevel - 1);
        max          = maxStatus.maxMana * (currentLv - 1) / (maxLevel - 1);
        stat.maxMana = min + max;
        stat.mana    = stat.maxMana;

        stat.CalculateStatus();
    }