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.20 by root, Mon Oct 12 14:00:57 2009 UTC vs.
Revision 1.21 by root, Fri Nov 6 12:27:05 2009 UTC

72 0.0, /* AT_CHAOS */ 72 0.0, /* AT_CHAOS */
73 0.0 /* AT_COUNTERSPELL */ 73 0.0 /* AT_COUNTERSPELL */
74}; 74};
75 75
76/* 76/*
77 * Returns true if the monster specified has any innate abilities.
78 */
79int
80has_ability (const object *ob)
81{
82 object *tmp;
83
84 for (tmp = ob->inv; tmp != NULL; tmp = tmp->below)
85 if (tmp->type == SPELL || tmp->type == SPELLBOOK)
86 return true;
87 return false;
88}
89
90/*
77 * new_exp() is an alternative way to calculate experience based 91 * new_exp() is an alternative way to calculate experience based
78 * on the ability of a monster. 92 * on the ability of a monster.
79 * It's far from perfect, and doesn't consider everything which 93 * It's far from perfect, and doesn't consider everything which
80 * can be considered, thus it's only used in debugging. 94 * can be considered, thus it's only used in debugging.
81 * this is only used with one of the dumpflags, 95 * this is only used with one of the dumpflags,
118 exp *= (20.0 + ob->stats.Con) / 20.0; 132 exp *= (20.0 + ob->stats.Con) / 20.0;
119 if (QUERY_FLAG (ob, FLAG_STAND_STILL)) 133 if (QUERY_FLAG (ob, FLAG_STAND_STILL))
120 exp /= 2; 134 exp /= 2;
121 135
122 return (int) exp; 136 return (int) exp;
123}
124
125/*
126 * Returns true if the monster specified has any innate abilities.
127 */
128
129int
130has_ability (const object *ob)
131{
132 object *tmp;
133
134 for (tmp = ob->inv; tmp != NULL; tmp = tmp->below)
135 if (tmp->type == SPELL || tmp->type == SPELLBOOK)
136 return true;
137 return false;
138} 137}
139 138
140/* This loads the experience table from the exp_table 139/* This loads the experience table from the exp_table
141 * file. This tends to exit on any errors, since it 140 * file. This tends to exit on any errors, since it
142 * populates the table as it goes along, so if there 141 * populates the table as it goes along, so if there

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines