Пример #1
0
    protected Character(CharacterSO other)
    {
        // name
        displayName = other.displayName;

        // stats
        attributes = other.attributes;
        elementAttack = other.elementAttack;
        elementDefense = other.elementDefense;
        combatStats = other.combatStats;

        // level and class
        level = other.level;
        charClass = other.charClass;

        // create armor and weapon configs from class rules
        mWeaponConfig = charClass.CreateWeaponConfig();
        mArmorConfig = charClass.CreateArmorConfig();

        for (int i=0; i < other.weapons.Length; i++) {
            mWeaponConfig.EquipWeapon(other.weapons[i], i);
        }

        // TODO, this should be tightly coupled with SO implementation
        //		for (int i=0; i < other.weapons.Length; i++) {
        //			mArmorConfig.EquipArmor(other.armors[i], i);
        //		}

        curHP = maxHP;
    }