ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/living.C
(Generate patch)

Comparing deliantra/server/common/living.C (file contents):
Revision 1.128 by root, Mon Oct 29 23:55:52 2012 UTC vs.
Revision 1.129 by root, Mon Nov 12 03:14:32 2012 UTC

108 * These limits are probably overly generous, but being there were no values 108 * These limits are probably overly generous, but being there were no values
109 * before, you need to start someplace. 109 * before, you need to start someplace.
110 */ 110 */
111 111
112const uint32 weight_limit[MAX_STAT + 1] = { 112const uint32 weight_limit[MAX_STAT + 1] = {
113 200000, /* 0 */ 113 200000, /* 0 */
114 250000, 300000, 350000, 400000, 500000, /* 5 */ 114 250000, 300000, 350000, 400000, 500000, /* 5 */
115 600000, 700000, 800000, 900000, 1000000, /* 10 */ 115 600000, 700000, 800000, 900000, 1000000, /* 10 */
116 1100000, 1200000, 1300000, 1400000, 1500000, /* 15 */ 116 1100000, 1200000, 1300000, 1400000, 1500000, /* 15 */
117 1650000, 1800000, 1950000, 2100000, 2250000, /* 20 */ 117 1650000, 1800000, 1950000, 2100000, 2250000, /* 20 */
118 2400000, 2550000, 2700000, 2850000, 3000000, /* 25 */ 118 2400000, 2550000, 2700000, 2850000, 3000000, /* 25 */
119 3250000, 3500000, 3750000, 4000000, 4500000 /*30 */ 119 3250000, 3500000, 3750000, 4000000, 4500000 /* 30 */
120}; 120};
121 121
122const int learn_spell[MAX_STAT + 1] = { 122const int learn_spell[MAX_STAT + 1] = {
123 0, 0, 0, 1, 2, 4, 8, 12, 16, 25, 36, 45, 55, 65, 70, 75, 80, 85, 90, 95, 100, 100, 100, 100, 100, 123 0, 0, 0, 1, 2, 4, 8, 12, 16, 25, 36, 45, 55, 65, 70, 75, 80, 85, 90, 95, 100, 100, 100, 100, 100,
124 100, 100, 100, 100, 100, 100 124 100, 100, 100, 100, 100, 100
996 996
997 if (tmp->stats.ac) 997 if (tmp->stats.ac)
998 ac -= tmp->stats.ac + tmp->magic; 998 ac -= tmp->stats.ac + tmp->magic;
999 999
1000 if (settings.spell_encumbrance == TRUE && type == PLAYER) 1000 if (settings.spell_encumbrance == TRUE && type == PLAYER)
1001 contr->encumbrance += 3 * tmp->weight / 1000; 1001 contr->encumbrance += weight_to_kg_approx (3 * tmp->weight);
1002 } 1002 }
1003 1003
1004 break; 1004 break;
1005 1005
1006 case SHIELD: 1006 case SHIELD:
1007 if (settings.spell_encumbrance == TRUE && type == PLAYER) 1007 if (settings.spell_encumbrance == TRUE && type == PLAYER)
1008 contr->encumbrance += tmp->weight / 2000; 1008 contr->encumbrance += weight_to_kg_approx (tmp->weight) >> 1;
1009 //FALLTHROUGH 1009 //FALLTHROUGH
1010 case RING: 1010 case RING:
1011 case AMULET: 1011 case AMULET:
1012 case GIRDLE: 1012 case GIRDLE:
1013 case HELMET: 1013 case HELMET:
1047 * go. 1047 * go.
1048 */ 1048 */
1049 1049
1050 if (type == PLAYER) 1050 if (type == PLAYER)
1051 if (settings.spell_encumbrance) 1051 if (settings.spell_encumbrance)
1052 contr->encumbrance += tmp->weight * 3 / 1000; 1052 contr->encumbrance += weight_to_kg_approx (3 * tmp->weight);
1053 1053
1054 break; 1054 break;
1055 1055
1056 case ARMOUR: /* Only the best of these three are used: */ 1056 case ARMOUR: /* Only the best of these three are used: */
1057 if (settings.spell_encumbrance == TRUE && type == PLAYER) 1057 if (settings.spell_encumbrance == TRUE && type == PLAYER)
1058 contr->encumbrance += tmp->weight / 1000; 1058 contr->encumbrance += weight_to_kg_approx (tmp->weight);
1059 1059
1060 case BRACERS: 1060 case BRACERS:
1061 case FORCE: 1061 case FORCE:
1062 if (tmp->stats.wc) 1062 if (tmp->stats.wc)
1063 { 1063 {
1289 /* f is a number the represents the number of kg above (positive num) 1289 /* f is a number the represents the number of kg above (positive num)
1290 * or below (negative number) that the player is carrying. If above 1290 * or below (negative number) that the player is carrying. If above
1291 * weight limit, then player suffers a speed reduction based on how 1291 * weight limit, then player suffers a speed reduction based on how
1292 * much above he is, and what is max carry is 1292 * much above he is, and what is max carry is
1293 */ 1293 */
1294 float f = (carrying / 1000) - max_carry[stats.Str]; 1294 double f = weight_to_kg_approx (carrying) - max_carry[stats.Str];
1295 if (f > 0.f) 1295 if (f > 0.f)
1296 speed = speed / (1.f + f / max_carry[stats.Str]); 1296 speed /= (1.f + f / max_carry[stats.Str]);
1297 } 1297 }
1298 1298
1299 speed += bonus_speed / 10.f; /* Not affected by limits */ 1299 speed += bonus_speed / 10.f; /* Not affected by limits */
1300 speed *= speed_reduce_from_disease; 1300 speed *= speed_reduce_from_disease;
1301 1301

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines