Example #1
0
    // Equips Weapon
    public IEnumerator EquipWeaponCR(int i)
    {
        if (pm.sword != null)
        {
            Destroy(pm.sword);
        }
        p.EquippedWeapon = weps[i].WeaponID;
        pm.WeaponChanged();
        pm.instantiateSheathedSword();
        WeaponScript newwep = pm.sword.GetComponent <WeaponScript>();

        newwep.LEVEL = weps[i].UpgradeLevel;
        newwep.CheckForUpgraded();
        yield return(new WaitForFixedUpdate());

        newwep.RecalculateBlocking();
        newwep.RecalculateDamage();

        /*
         * wepTITLE.text = weps[i].WeaponID;
         * wepDESCRIP.text = weps[i].Description;
         * GameObject tempwep = pm.sword;
         * WeaponScript ws = tempwep.GetComponent<WeaponScript>();
         * wepBASE[0].text = ws.BASE_Te.ToString();
         * wepBASE[1].text = ws.BASE_Lu.ToString();
         * wepBASE[2].text = ws.BASE_So.ToString();
         * wepBASE[3].text = ws.BASE_In.ToString();
         * wepBASE[4].text = ws.BASE_Ch.ToString();
         * wepBASE[5].text = ws.BASE_Li.ToString();
         * wepBASE[6].text = ws.BASE_De.ToString();
         *
         * wepSCALING[0].text = GetReadableScaling(0, ws);
         * wepSCALING[1].text = GetReadableScaling(1, ws);
         * wepSCALING[2].text = GetReadableScaling(2, ws);
         * wepSCALING[3].text = GetReadableScaling(3, ws);
         * wepSCALING[4].text = GetReadableScaling(4, ws);
         * wepSCALING[5].text = GetReadableScaling(5, ws);
         * wepSCALING[6].text = GetReadableScaling(6, ws);
         *
         * ws.RecalculateDamage();
         * ws.RecalculateBlocking();
         * wepTOTALDMG[0].text = ws.TOTAL_Te.ToString();*/
        StartCoroutine(ColorStatChanges());
    }