1 | /* |
1 | /* |
2 | * CrossFire, A Multiplayer game for X-windows |
2 | * CrossFire, A Multiplayer game |
3 | * |
3 | * |
4 | * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
4 | * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
5 | * Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
6 | * Copyright (C) 1992 Frank Tore Johansen |
6 | * Copyright (C) 1992 Frank Tore Johansen |
7 | * |
7 | * |
… | |
… | |
1150 | case HELMET: |
1150 | case HELMET: |
1151 | case BOOTS: |
1151 | case BOOTS: |
1152 | case GLOVES: |
1152 | case GLOVES: |
1153 | case CLOAK: |
1153 | case CLOAK: |
1154 | if (tmp->stats.wc) |
1154 | if (tmp->stats.wc) |
1155 | wc -= (tmp->stats.wc + tmp->magic); |
1155 | wc -= tmp->stats.wc + tmp->magic; |
1156 | |
1156 | |
1157 | if (tmp->stats.dam) |
1157 | if (tmp->stats.dam) |
1158 | stats.dam += (tmp->stats.dam + tmp->magic); |
1158 | stats.dam += tmp->stats.dam + tmp->magic; |
1159 | |
1159 | |
1160 | if (tmp->stats.ac) |
1160 | if (tmp->stats.ac) |
1161 | ac -= (tmp->stats.ac + tmp->magic); |
1161 | ac -= tmp->stats.ac + tmp->magic; |
1162 | |
1162 | |
1163 | break; |
1163 | break; |
1164 | |
1164 | |
|
|
1165 | case BOW: |
1165 | case WEAPON: |
1166 | case WEAPON: |
1166 | wc -= (tmp->stats.wc + tmp->magic); |
1167 | wc -= tmp->stats.wc + tmp->magic; |
1167 | |
1168 | |
1168 | if (tmp->stats.ac && tmp->stats.ac + tmp->magic > 0) |
1169 | if (tmp->stats.ac && tmp->stats.ac + tmp->magic > 0) |
1169 | ac -= tmp->stats.ac + tmp->magic; |
1170 | ac -= tmp->stats.ac + tmp->magic; |
1170 | |
1171 | |
1171 | stats.dam += (tmp->stats.dam + tmp->magic); |
1172 | stats.dam += tmp->stats.dam + tmp->magic; |
1172 | weapon_weight = tmp->weight; |
1173 | weapon_weight = tmp->weight; |
1173 | weapon_speed = ((int) WEAPON_SPEED (tmp) * 2 - tmp->magic) / 2; |
1174 | weapon_speed = ((int) WEAPON_SPEED (tmp) * 2 - tmp->magic) / 2; |
1174 | |
1175 | |
1175 | if (weapon_speed < 0) |
1176 | if (weapon_speed < 0) |
1176 | weapon_speed = 0; |
1177 | weapon_speed = 0; |
… | |
… | |
1386 | * monster bonus the same as before. -b.t. |
1387 | * monster bonus the same as before. -b.t. |
1387 | */ |
1388 | */ |
1388 | |
1389 | |
1389 | if (type == PLAYER && wc_obj && wc_obj->level > 1) |
1390 | if (type == PLAYER && wc_obj && wc_obj->level > 1) |
1390 | { |
1391 | { |
1391 | wc -= (wc_obj->level + thaco_bonus[stats.Str]); |
1392 | wc -= wc_obj->level + thaco_bonus[stats.Str]; |
|
|
1393 | |
1392 | for (i = 1; i < wc_obj->level; i++) |
1394 | for (i = 1; i < wc_obj->level; i++) |
1393 | { |
1395 | { |
1394 | /* addtional wc every 6 levels */ |
1396 | /* addtional wc every 6 levels */ |
1395 | if (!(i % 6)) |
1397 | if (!(i % 6)) |
1396 | wc--; |
1398 | wc--; |
|
|
1399 | |
1397 | /* addtional dam every 4 levels. */ |
1400 | /* addtional dam every 4 levels. */ |
1398 | if (!(i % 4) && (dam_bonus[stats.Str] >= 0)) |
1401 | if (!(i % 4) && dam_bonus[stats.Str] >= 0) |
1399 | stats.dam += (1 + (dam_bonus[stats.Str] / 5)); |
1402 | stats.dam += 1 + dam_bonus[stats.Str] / 5; |
1400 | } |
1403 | } |
1401 | } |
1404 | } |
1402 | else |
1405 | else |
1403 | wc -= (level + thaco_bonus[stats.Str]); |
1406 | wc -= level + thaco_bonus[stats.Str]; |
1404 | |
1407 | |
1405 | stats.dam += dam_bonus[stats.Str]; |
1408 | stats.dam += dam_bonus[stats.Str]; |
1406 | |
1409 | |
1407 | if (stats.dam < 1) |
1410 | if (stats.dam < 1) |
1408 | stats.dam = 1; |
1411 | stats.dam = 1; |
… | |
… | |
1973 | * these last two values are only used for players. |
1976 | * these last two values are only used for players. |
1974 | */ |
1977 | */ |
1975 | void |
1978 | void |
1976 | change_exp (object *op, sint64 exp, const char *skill_name, int flag) |
1979 | change_exp (object *op, sint64 exp, const char *skill_name, int flag) |
1977 | { |
1980 | { |
1978 | |
|
|
1979 | #ifdef EXP_DEBUG |
1981 | #ifdef EXP_DEBUG |
1980 | LOG (llevDebug, "change_exp() called for %s, exp = %" PRId64 "\n", query_name (op), exp); |
1982 | LOG (llevDebug, "change_exp() called for %s, exp = %" PRId64 "\n", query_name (op), exp); |
1981 | #endif |
1983 | #endif |
1982 | |
1984 | |
1983 | /* safety */ |
1985 | /* safety */ |
… | |
… | |
2032 | |
2034 | |
2033 | /* Applies a death penalty experience, the size of this is defined by the |
2035 | /* Applies a death penalty experience, the size of this is defined by the |
2034 | * settings death_penalty_percentage and death_penalty_levels, and by the |
2036 | * settings death_penalty_percentage and death_penalty_levels, and by the |
2035 | * amount of permenent experience, whichever gives the lowest loss. |
2037 | * amount of permenent experience, whichever gives the lowest loss. |
2036 | */ |
2038 | */ |
2037 | |
|
|
2038 | void |
2039 | void |
2039 | apply_death_exp_penalty (object *op) |
2040 | apply_death_exp_penalty (object *op) |
2040 | { |
2041 | { |
2041 | object *tmp; |
2042 | object *tmp; |
2042 | sint64 loss; |
2043 | sint64 loss; |