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; }
public static AttributeVector operator *(AttributeVector a1, AttributeVector a2) { AttributeVector result = new AttributeVector(); result.strength = a1.strength * a2.strength; result.vitality = a1.vitality * a2.vitality; result.dexerity = a1.dexerity * a2.dexerity; result.agility = a1.agility * a2.agility; result.wisdom = a1.wisdom * a2.wisdom; result.inteligence = a1.inteligence * a2.inteligence; result.luck = a1.luck * a2.luck; return result; }
public void LoadAttribute(AttributeVector attributes) { if (attributes != null) { mPropertyAdd[(int)CombatPropertyType.STR] = attributes.strength; mPropertyAdd[(int)CombatPropertyType.VIT] = attributes.vitality; mPropertyAdd[(int)CombatPropertyType.DEX] = attributes.dexerity; mPropertyAdd[(int)CombatPropertyType.AGI] = attributes.agility; mPropertyAdd[(int)CombatPropertyType.WIS] = attributes.wisdom; mPropertyAdd[(int)CombatPropertyType.INT] = attributes.inteligence; mPropertyAdd[(int)CombatPropertyType.LUCK] = attributes.luck; } }
public void LoadDamageScalingAttributes(AttributeVector attributes) { if (attributes != null) { mPropertyAdd[(int)CombatPropertyType.SCALE_STR] = attributes.strength; mPropertyAdd[(int)CombatPropertyType.SCALE_VIT] = attributes.vitality; mPropertyAdd[(int)CombatPropertyType.SCALE_DEX] = attributes.dexerity; mPropertyAdd[(int)CombatPropertyType.SCALE_AGI] = attributes.agility; mPropertyAdd[(int)CombatPropertyType.SCALE_WIS] = attributes.wisdom; mPropertyAdd[(int)CombatPropertyType.SCALE_INT] = attributes.inteligence; mPropertyAdd[(int)CombatPropertyType.SCALE_LUCK] = attributes.luck; } }