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.52 by root, Sat May 12 18:34:19 2007 UTC vs.
Revision 1.54 by root, Sat May 12 19:30:18 2007 UTC

939 vuln[i] += ((100 - vuln[i]) * -tmp->resist[i]) / 100; 939 vuln[i] += ((100 - vuln[i]) * -tmp->resist[i]) / 100;
940 } 940 }
941 } 941 }
942 942
943 /* There may be other things that should not adjust the attacktype */ 943 /* There may be other things that should not adjust the attacktype */
944 if ((tmp->type != WEAPON && tmp->type != BOW && tmp->type != SYMPTOM) 944 if (tmp->type != SYMPTOM)
945 || current_weapon == tmp)
946 { 945 {
947 attacktype |= tmp->attacktype; 946 attacktype |= tmp->attacktype;
948 path_attuned |= tmp->path_attuned; 947 path_attuned |= tmp->path_attuned;
949 path_repelled |= tmp->path_repelled; 948 path_repelled |= tmp->path_repelled;
950 path_denied |= tmp->path_denied; 949 path_denied |= tmp->path_denied;
1012 1011
1013 if (weapon_speed < 0) 1012 if (weapon_speed < 0)
1014 weapon_speed = 0; 1013 weapon_speed = 0;
1015 1014
1016 weapon_weight = tmp->weight; 1015 weapon_weight = tmp->weight;
1017 stats.dam += tmp->stats.dam * (1 + (chosen_skill->level / 9)); 1016 stats.dam += 1 + (chosen_skill->level * tmp->stats.dam / 9);
1018 1017
1019 if (tmp->magic) 1018 if (tmp->magic)
1020 stats.dam += tmp->magic; 1019 stats.dam += tmp->magic;
1021 } 1020 }
1022 1021
1226 stats.maxsp = (sint16)sp_tmp; 1225 stats.maxsp = (sint16)sp_tmp;
1227 1226
1228 for (i = 11; i <= mana_obj->level; i++) 1227 for (i = 11; i <= mana_obj->level; i++)
1229 stats.maxsp += 2; 1228 stats.maxsp += 2;
1230 } 1229 }
1230
1231 /* Characters can get their sp supercharged via rune of transferrance */ 1231 /* Characters can get their sp supercharged via rune of transferrance */
1232 if (stats.sp > stats.maxsp * 2) 1232 if (stats.sp > stats.maxsp * 2)
1233 stats.sp = stats.maxsp * 2; 1233 stats.sp = stats.maxsp * 2;
1234 1234
1235 /* set maxgrace, notice 3-4 lines below it depends on both Wis and Pow */ 1235 /* set maxgrace, notice 3-4 lines below it depends on both Wis and Pow */
1266 1266
1267 /* two grace points per level after 11 */ 1267 /* two grace points per level after 11 */
1268 for (i = 11; i <= grace_obj->level; i++) 1268 for (i = 11; i <= grace_obj->level; i++)
1269 stats.maxgrace += 2; 1269 stats.maxgrace += 2;
1270 } 1270 }
1271
1271 /* No limit on grace vs maxgrace */ 1272 /* No limit on grace vs maxgrace */
1272 1273
1273 if (contr->braced) 1274 if (contr->braced)
1274 { 1275 {
1275 ac += 2; 1276 ac += 2;
1288 * we give the player a bonus here in wc and dam 1289 * we give the player a bonus here in wc and dam
1289 * to make up for the change. Note that I left the 1290 * to make up for the change. Note that I left the
1290 * monster bonus the same as before. -b.t. 1291 * monster bonus the same as before. -b.t.
1291 */ 1292 */
1292 1293
1293 if (type == PLAYER && wc_obj && wc_obj->level > 1) 1294 if (contr && wc_obj && wc_obj->level > 1)
1294 { 1295 {
1295 wc -= wc_obj->level + thaco_bonus[stats.Str]; 1296 wc -= wc_obj->level + thaco_bonus[stats.Str];
1296 1297
1297 for (i = 1; i < wc_obj->level; i++) 1298 for (i = 1; i < wc_obj->level; i++)
1298 { 1299 {
1299 /* addtional wc every 6 levels */ 1300 /* additional wc every 6 levels */
1300 if (!(i % 6)) 1301 if (!(i % 6))
1301 wc--; 1302 wc--;
1302 1303
1303 /* addtional dam every 4 levels. */ 1304 /* additional dam every 4 levels. */
1304 if (!(i % 4) && dam_bonus[stats.Str] >= 0) 1305 if (!(i % 4) && dam_bonus[stats.Str] >= 0)
1305 stats.dam += 1 + dam_bonus[stats.Str] / 5; 1306 stats.dam += 1 + dam_bonus[stats.Str] / 5;
1306 } 1307 }
1307 } 1308 }
1308 else 1309 else
1604 } 1605 }
1605 1606
1606 return skill_obj; 1607 return skill_obj;
1607} 1608}
1608 1609
1609
1610/* player_lvl_adj() - for the new exp system. we are concerned with 1610/* player_lvl_adj() - for the new exp system. we are concerned with
1611 * whether the player gets more hp, sp and new levels. 1611 * whether the player gets more hp, sp and new levels.
1612 * Note this this function should only be called for players. Monstes 1612 * Note this this function should only be called for players. Monstes
1613 * don't really gain levels 1613 * don't really gain levels
1614 * who is the player, op is what we are checking to gain the level 1614 * who is the player, op is what we are checking to gain the level
1624 1624
1625 if (op->level < settings.max_level && op->stats.exp >= level_exp (op->level + 1, who->expmul)) 1625 if (op->level < settings.max_level && op->stats.exp >= level_exp (op->level + 1, who->expmul))
1626 { 1626 {
1627 op->level++; 1627 op->level++;
1628 1628
1629 if (op != NULL && op == who && op->stats.exp > 1 && is_dragon_pl (who)) 1629 if (op && op == who && op->stats.exp > 1 && is_dragon_pl (who))
1630 dragon_level_gain (who); 1630 dragon_level_gain (who);
1631 1631
1632 /* Only roll these if it is the player (who) that gained the level */ 1632 /* Only roll these if it is the player (who) that gained the level */
1633 if (op == who && (who->level < 11) && who->type == PLAYER) 1633 if (op == who && (who->level < 11) && who->type == PLAYER)
1634 { 1634 {
1642 { 1642 {
1643 if (op->type != PLAYER) 1643 if (op->type != PLAYER)
1644 sprintf (buf, "You are now level %d in the %s skill.", op->level, &op->name); 1644 sprintf (buf, "You are now level %d in the %s skill.", op->level, &op->name);
1645 else 1645 else
1646 sprintf (buf, "You are now level %d.", op->level); 1646 sprintf (buf, "You are now level %d.", op->level);
1647
1647 if (who) 1648 if (who)
1648 new_draw_info (NDI_UNIQUE | NDI_RED, 0, who, buf); 1649 new_draw_info (NDI_UNIQUE | NDI_RED, 0, who, buf);
1649 } 1650 }
1651
1650 player_lvl_adj (who, op); /* To increase more levels */ 1652 player_lvl_adj (who, op); /* To increase more levels */
1651 } 1653 }
1652 else if (op->level > 1 && op->stats.exp < level_exp (op->level, who->expmul)) 1654 else if (op->level > 1 && op->stats.exp < level_exp (op->level, who->expmul))
1653 { 1655 {
1654 op->level--; 1656 op->level--;
1655 who->update_stats (); 1657 who->update_stats ();
1658
1656 if (op->type != PLAYER) 1659 if (op->type != PLAYER)
1657 { 1660 {
1658 sprintf (buf, "You are now level %d in the %s skill.", op->level, &op->name); 1661 sprintf (buf, "You are now level %d in the %s skill.", op->level, &op->name);
1659 new_draw_info (NDI_UNIQUE | NDI_RED, 0, who, buf); 1662 new_draw_info (NDI_UNIQUE | NDI_RED, 0, who, buf);
1660 } 1663 }
1664
1661 player_lvl_adj (who, op); /* To decrease more levels */ 1665 player_lvl_adj (who, op); /* To decrease more levels */
1662 } 1666 }
1663 1667
1664 /* check if the spell data has changed */ 1668 /* check if the spell data has changed */
1665 esrv_update_stats (who->contr); 1669 esrv_update_stats (who->contr);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines