… | |
… | |
855 | { |
855 | { |
856 | base = base - (base * settings.armor_speed_improvement) / 100; |
856 | base = base - (base * settings.armor_speed_improvement) / 100; |
857 | pow++; |
857 | pow++; |
858 | } |
858 | } |
859 | |
859 | |
860 | ARMOUR_SPEED (armour) = (ARMOUR_SPEED (&armour->arch->clone) * base) / 100; |
860 | ARMOUR_SPEED (armour) = (ARMOUR_SPEED (armour->arch) * base) / 100; |
861 | } |
861 | } |
862 | else |
862 | else |
863 | ARMOUR_SPEED (armour) = (ARMOUR_SPEED (&armour->arch->clone) * (100 + armour->magic * settings.armor_speed_improvement)) / 100; |
863 | ARMOUR_SPEED (armour) = (ARMOUR_SPEED (armour->arch) * (100 + armour->magic * settings.armor_speed_improvement)) / 100; |
864 | |
864 | |
865 | if (!settings.armor_weight_linear) |
865 | if (!settings.armor_weight_linear) |
866 | { |
866 | { |
867 | int base = 100; |
867 | int base = 100; |
868 | int pow = 0; |
868 | int pow = 0; |
… | |
… | |
871 | { |
871 | { |
872 | base = base - (base * settings.armor_weight_reduction) / 100; |
872 | base = base - (base * settings.armor_weight_reduction) / 100; |
873 | pow++; |
873 | pow++; |
874 | } |
874 | } |
875 | |
875 | |
876 | armour->weight = (armour->arch->clone.weight * base) / 100; |
876 | armour->weight = (armour->arch->weight * base) / 100; |
877 | } |
877 | } |
878 | else |
878 | else |
879 | armour->weight = (armour->arch->clone.weight * (100 - armour->magic * settings.armor_weight_reduction)) / 100; |
879 | armour->weight = (armour->arch->weight * (100 - armour->magic * settings.armor_weight_reduction)) / 100; |
880 | |
880 | |
881 | if (armour->weight <= 0) |
881 | if (armour->weight <= 0) |
882 | { |
882 | { |
883 | LOG (llevInfo, "Warning: enchanted armours can have negative weight\n."); |
883 | LOG (llevInfo, "Warning: enchanted armours can have negative weight\n."); |
884 | armour->weight = 1; |
884 | armour->weight = 1; |
885 | } |
885 | } |
886 | |
886 | |
887 | armour->item_power = get_power_from_ench (armour->arch->clone.item_power + armour->magic); |
887 | armour->item_power = get_power_from_ench (armour->arch->item_power + armour->magic); |
888 | |
888 | |
889 | if (op->type == PLAYER) |
889 | if (op->type == PLAYER) |
890 | { |
890 | { |
891 | esrv_send_item (op, armour); |
891 | esrv_send_item (op, armour); |
892 | if (QUERY_FLAG (armour, FLAG_APPLIED)) |
892 | if (QUERY_FLAG (armour, FLAG_APPLIED)) |
… | |
… | |
3846 | */ |
3846 | */ |
3847 | int i, j; |
3847 | int i, j; |
3848 | |
3848 | |
3849 | for (i = 0; i < NUM_STATS; i++) |
3849 | for (i = 0; i < NUM_STATS; i++) |
3850 | { |
3850 | { |
3851 | int race_bonus = pl->arch->clone.stats.stat (i); |
3851 | int race_bonus = pl->arch->stats.stat (i); |
3852 | sint8 stat = stats->stat (i) + ns->stat (i); |
3852 | sint8 stat = stats->stat (i) + ns->stat (i); |
3853 | |
3853 | |
3854 | if (stat > 20 + race_bonus) |
3854 | if (stat > 20 + race_bonus) |
3855 | { |
3855 | { |
3856 | excess_stat++; |
3856 | excess_stat++; |
… | |
… | |
3866 | |
3866 | |
3867 | if (i == CHA) |
3867 | if (i == CHA) |
3868 | continue; /* exclude cha from this */ |
3868 | continue; /* exclude cha from this */ |
3869 | |
3869 | |
3870 | int stat = stats->stat (i); |
3870 | int stat = stats->stat (i); |
3871 | int race_bonus = pl->arch->clone.stats.stat (i); |
3871 | int race_bonus = pl->arch->stats.stat (i); |
3872 | if (stat < 20 + race_bonus) |
3872 | if (stat < 20 + race_bonus) |
3873 | { |
3873 | { |
3874 | change_attr_value (stats, i, 1); |
3874 | change_attr_value (stats, i, 1); |
3875 | excess_stat--; |
3875 | excess_stat--; |
3876 | } |
3876 | } |