コード例 #1
0
ファイル: Character.cs プロジェクト: riftgarret/alphac
    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;
    }
コード例 #2
0
 public void LoadCombatStats(CombatStatsVector combatStats)
 {
     if (combatStats != null) {
         mPropertyAdd[(int)CombatPropertyType.PHYSICAL_POWER] = combatStats.physicalPower;
         mPropertyAdd[(int)CombatPropertyType.PHYSICAL_DEFENSE] = combatStats.physicalDefense;
         mPropertyAdd[(int)CombatPropertyType.MAGICAL_POWER] = combatStats.magicPower;
         mPropertyAdd[(int)CombatPropertyType.MAGICAL_DEFENSE] = combatStats.magicDefense;
         mPropertyAdd[(int)CombatPropertyType.EVASION] = combatStats.evasion;
         mPropertyAdd[(int)CombatPropertyType.ACCURACY] = combatStats.accuracy;
         mPropertyAdd[(int)CombatPropertyType.CRIT_EVASION] = combatStats.critEvasion;
         mPropertyAdd[(int)CombatPropertyType.CRIT_ACCURACY] = combatStats.critAccuracy;
         mPropertyAdd[(int)CombatPropertyType.CRIT_DEFENSE] = combatStats.critDefense;
         mPropertyAdd[(int)CombatPropertyType.CRIT_POWER] = combatStats.critPower;
     }
 }