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

Comparing deliantra/server/common/exp.C (file contents):
Revision 1.24 by root, Wed Nov 11 03:52:44 2009 UTC vs.
Revision 1.25 by root, Sun Nov 29 09:41:27 2009 UTC

127 127
128 exp = (ob->stats.maxhp < 5) ? 5 : ob->stats.maxhp; 128 exp = (ob->stats.maxhp < 5) ? 5 : ob->stats.maxhp;
129 exp *= (QUERY_FLAG (ob, FLAG_CAST_SPELL) && has_ability (ob)) ? (40 + (ob->stats.maxsp > 80 ? 80 : ob->stats.maxsp)) / 40 : 1; 129 exp *= (QUERY_FLAG (ob, FLAG_CAST_SPELL) && has_ability (ob)) ? (40 + (ob->stats.maxsp > 80 ? 80 : ob->stats.maxsp)) / 40 : 1;
130 exp *= (80.0 / (70.0 + ob->stats.wc)) * (80.0 / (70.0 + ob->stats.ac)) * (50.0 + ob->stats.dam) / 50.0; 130 exp *= (80.0 / (70.0 + ob->stats.wc)) * (80.0 / (70.0 + ob->stats.ac)) * (50.0 + ob->stats.dam) / 50.0;
131 exp *= att_mult * prot_mult * spec_mult; 131 exp *= att_mult * prot_mult * spec_mult;
132 exp *= 2.0 / (2.0 - ((fabs (ob->speed) < 0.95) ? fabs (ob->speed) : 0.95)); 132 exp *= 2.0 / (2.0 - min (ob->speed, 0.95));
133 exp *= (20.0 + ob->stats.Con) / 20.0; 133 exp *= (20.0 + ob->stats.Con) / 20.0;
134 if (QUERY_FLAG (ob, FLAG_STAND_STILL)) 134 if (QUERY_FLAG (ob, FLAG_STAND_STILL))
135 exp /= 2; 135 exp /= 2;
136 136
137 return (int) exp; 137 return exp;
138} 138}
139 139
140/* This loads the experience table from the exp_table 140/* This loads the experience table from the exp_table
141 * file. This tends to exit on any errors, since it 141 * file. This tends to exit on any errors, since it
142 * populates the table as it goes along, so if there 142 * populates the table as it goes along, so if there
143 * are errors, the table is likely in an inconsistent 143 * are errors, the table is likely in an inconsistent
144 * state. 144 * state.
145 */ 145 */
146void 146void
147init_experience (void) 147init_experience ()
148{ 148{
149 char buf[MAX_BUF], *cp; 149 char buf[MAX_BUF], *cp;
150 int lastlevel = 0, comp; 150 int lastlevel = 0, comp;
151 sint64 lastexp = -1, tmpexp; 151 sint64 lastexp = -1, tmpexp;
152 FILE *fp; 152 FILE *fp;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines