1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992 Frank Tore Johansen |
6 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * the terms of the Affero GNU General Public License as published by the |
9 | * the terms of the Affero GNU General Public License as published by the |
… | |
… | |
1023 | if (tmp->stats.ac) |
1023 | if (tmp->stats.ac) |
1024 | ac -= tmp->stats.ac + tmp->magic; |
1024 | ac -= tmp->stats.ac + tmp->magic; |
1025 | |
1025 | |
1026 | break; |
1026 | break; |
1027 | |
1027 | |
1028 | case WAND: |
1028 | case RANGED: |
1029 | case ROD: |
|
|
1030 | case HORN: |
|
|
1031 | break; |
|
|
1032 | |
|
|
1033 | case BOW: |
1029 | case BOW: |
1034 | case WEAPON: |
1030 | case WEAPON: |
1035 | wc -= tmp->stats.wc + tmp->magic; |
1031 | wc -= tmp->stats.wc + tmp->magic; |
1036 | |
1032 | |
1037 | if (tmp->stats.ac && tmp->stats.ac + tmp->magic > 0) |
1033 | if (tmp->stats.ac && tmp->stats.ac + tmp->magic > 0) |
… | |
… | |
1090 | |
1086 | |
1091 | if (tmp->stats.ac) |
1087 | if (tmp->stats.ac) |
1092 | ac -= tmp->stats.ac + tmp->magic; |
1088 | ac -= tmp->stats.ac + tmp->magic; |
1093 | |
1089 | |
1094 | if (ARMOUR_SPEED (tmp)) |
1090 | if (ARMOUR_SPEED (tmp)) |
1095 | max_speed = min (max_speed, ARMOUR_SPEED (tmp) / 10.f); |
1091 | min_it (max_speed, ARMOUR_SPEED (tmp) / 10.f); |
1096 | |
1092 | |
1097 | break; |
1093 | break; |
1098 | } /* switch tmp->type */ |
1094 | } /* switch tmp->type */ |
1099 | } /* item is equipped */ |
1095 | } /* item is equipped */ |
1100 | } /* for loop of items */ |
1096 | } /* for loop of items */ |
… | |
… | |
1905 | tmp->stats.exp -= loss; |
1901 | tmp->stats.exp -= loss; |
1906 | player_lvl_adj (op, tmp); |
1902 | player_lvl_adj (op, tmp); |
1907 | } |
1903 | } |
1908 | |
1904 | |
1909 | percentage_loss = op->stats.exp * settings.death_penalty_ratio / 100; |
1905 | percentage_loss = op->stats.exp * settings.death_penalty_ratio / 100; |
1910 | level_loss = op->stats.exp - levels[max (0, op->level - settings.death_penalty_level)]; |
1906 | level_loss = op->stats.exp - levels [max (0, op->level - settings.death_penalty_level)]; |
1911 | |
1907 | |
1912 | if (level_loss < 0) |
1908 | if (level_loss < 0) |
1913 | level_loss = 0; |
1909 | level_loss = 0; |
1914 | |
1910 | |
1915 | loss = check_exp_loss (op, min (level_loss, percentage_loss)); |
1911 | loss = check_exp_loss (op, min (level_loss, percentage_loss)); |