1 | /* |
1 | /* |
2 | * static char *rcsid_living_c = |
2 | * static char *rcsid_living_c = |
3 | * "$Id: living.c,v 1.6 2006/03/15 15:35:46 elmex Exp $"; |
3 | * "$Id: living.c,v 1.8 2006/06/25 22:19:41 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
68 | * at .667 |
68 | * at .667 |
69 | * This is figured by diff=(y-1)/(1+y), and for buy, it is 1+diff, for sell |
69 | * This is figured by diff=(y-1)/(1+y), and for buy, it is 1+diff, for sell |
70 | * it is 1-diff |
70 | * it is 1-diff |
71 | */ |
71 | */ |
72 | |
72 | |
73 | const float cha_bonus[MAX_STAT + 1]={10.0, 10.0, 9.0, 8.0, 7.0, 6.0, /*<-5*/ |
73 | const float cha_bonus[MAX_STAT + 1] = { 10.0, |
74 | 5.0, 4.5, 4.0, 3.5, 3.0, /*<-10*/ 2.9, 2.8, 2.7, 2.6, 2.5, /*<-15*/ |
74 | 10.0, 9.0, 8.0, 7.0, 6.0, /* 5 */ |
75 | 2.4, 2.3, 2.2, 2.1, 2.0, /*<-20*/ 1.95, 1.90, 1.85, 1.80, 1.75, /*25 */ |
75 | 5.0, 4.5, 4.0, 3.5, 3.0, /* 10 */ |
|
|
76 | 2.9, 2.8, 2.7, 2.6, 2.5, /* 15 */ |
|
|
77 | 2.4, 2.3, 2.2, 2.1, 2.0, /* 20 */ |
|
|
78 | 1.9, 1.8, 1.7, 1.6, 1.5, /* 25 */ |
76 | 1.70, 1.65, 1.60, 1.55, 1.50 /*30 */ |
79 | 1.4, 1.3, 1.2, 1.1, 1.0 /* 30 */ |
77 | }; |
80 | }; |
78 | |
81 | |
79 | const int dex_bonus[MAX_STAT + 1]={ |
82 | const int dex_bonus[MAX_STAT + 1]={ |
80 | -4,-3,-2,-2,-1,-1,-1,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,6,6,7 |
83 | -4,-3,-2,-2,-1,-1,-1,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,6,6,7 |
81 | }; |
84 | }; |
82 | |
85 | |
83 | /* speed_bonus uses dex as its stat */ |
86 | /* speed_bonus uses dex as its stat */ |
84 | const float speed_bonus[MAX_STAT + 1]={ |
87 | const float speed_bonus[MAX_STAT + 1]={ |
85 | -0.4, -0.4, -0.3, -0.3, -0.2, -0.2, -0.2, -0.1, -0.1, -0.1, -0.05, 0, 0, 0, |
88 | -0.4, -0.35, -0.3, -0.25, -0.2, -0.16, -0.12, -0.09, -0.06, -0.03, -0.01, 0, 0.01, 0.03, |
86 | 0.05, 0.1, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8, 1.0, 1.2, 1.4, |
89 | 0.05, 0.1, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8, 1.0, 1.2, 1.4, |
87 | 1.6, 1.8, 2.0, 2.5, 3.0 |
90 | 1.6, 1.8, 2.0, 2.5, 3.0 |
88 | }; |
91 | }; |
89 | |
92 | |
90 | /* dam_bonus, thaco_bonus, max_carry, weight limit all are based on |
93 | /* dam_bonus, thaco_bonus, max_carry, weight limit all are based on |
… | |
… | |
1541 | |
1544 | |
1542 | if (op != NULL && op == who && op->stats.exp > 1 && is_dragon_pl(who)) |
1545 | if (op != NULL && op == who && op->stats.exp > 1 && is_dragon_pl(who)) |
1543 | dragon_level_gain(who); |
1546 | dragon_level_gain(who); |
1544 | |
1547 | |
1545 | /* Only roll these if it is the player (who) that gained the level */ |
1548 | /* Only roll these if it is the player (who) that gained the level */ |
1546 | if(who && op==who && (who->level < 11) && who->type==PLAYER) { |
1549 | if(op==who && (who->level < 11) && who->type==PLAYER) { |
1547 | who->contr->levhp[who->level] = die_roll(2, 4, who, PREFER_HIGH)+1; |
1550 | who->contr->levhp[who->level] = die_roll(2, 4, who, PREFER_HIGH)+1; |
1548 | who->contr->levsp[who->level] = die_roll(2, 3, who, PREFER_HIGH); |
1551 | who->contr->levsp[who->level] = die_roll(2, 3, who, PREFER_HIGH); |
1549 | who->contr->levgrace[who->level]=die_roll(2, 2, who, PREFER_HIGH)-1; |
1552 | who->contr->levgrace[who->level]=die_roll(2, 2, who, PREFER_HIGH)-1; |
1550 | } |
1553 | } |
1551 | |
1554 | |
1552 | if(who) fix_player(who); |
1555 | fix_player(who); |
1553 | if(op->level>1) { |
1556 | if(op->level>1) { |
1554 | if (op->type!=PLAYER) |
1557 | if (op->type!=PLAYER) |
1555 | sprintf(buf,"You are now level %d in the %s skill.",op->level,op->name); |
1558 | sprintf(buf,"You are now level %d in the %s skill.",op->level,op->name); |
1556 | else |
1559 | else |
1557 | sprintf(buf,"You are now level %d.",op->level); |
1560 | sprintf(buf,"You are now level %d.",op->level); |
1558 | if(who) new_draw_info(NDI_UNIQUE|NDI_RED, 0, who,buf); |
1561 | if(who) new_draw_info(NDI_UNIQUE|NDI_RED, 0, who,buf); |
1559 | } |
1562 | } |
1560 | player_lvl_adj(who,op); /* To increase more levels */ |
1563 | player_lvl_adj(who,op); /* To increase more levels */ |
1561 | } else if (op->level>1 && op->stats.exp<level_exp(op->level,who->expmul)) { |
1564 | } else if (op->level>1 && op->stats.exp<level_exp(op->level,who->expmul)) { |
1562 | op->level--; |
1565 | op->level--; |
1563 | if(who) fix_player(who); |
1566 | fix_player(who); |
1564 | if(op->type!=PLAYER) { |
1567 | if(op->type!=PLAYER) { |
1565 | sprintf(buf,"You are now level %d in the %s skill.",op->level,op->name); |
1568 | sprintf(buf,"You are now level %d in the %s skill.",op->level,op->name); |
1566 | if(who) new_draw_info(NDI_UNIQUE|NDI_RED, 0, who,buf); |
1569 | new_draw_info(NDI_UNIQUE|NDI_RED, 0, who,buf); |
1567 | } |
1570 | } |
1568 | player_lvl_adj(who,op); /* To decrease more levels */ |
1571 | player_lvl_adj(who,op); /* To decrease more levels */ |
1569 | } |
1572 | } |
1570 | /* check if the spell data has changed */ |
1573 | /* check if the spell data has changed */ |
1571 | esrv_update_spells(who->contr); |
1574 | esrv_update_spells(who->contr); |