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.26 by root, Fri Mar 26 00:59:20 2010 UTC

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 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2002 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 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
10 * Free Software Foundation, either version 3 of the License, or (at your 10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version. 11 * option) any later version.
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