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.23 by root, Fri Nov 6 13:03:34 2009 UTC

25#include <stdio.h> 25#include <stdio.h>
26#include <global.h> 26#include <global.h>
27 27
28sint64 *levels; 28sint64 *levels;
29 29
30float exp_att_mult[NROFATTACKS + 2] = { 30static float exp_att_mult[NROFATTACKS + 2] = {
31 0.0, /* AT_PHYSICAL */ 31 0.0, /* AT_PHYSICAL */
32 0.0, /* AT_MAGIC */ 32 0.0, /* AT_MAGIC */
33 0.0, /* AT_FIRE */ 33 0.0, /* AT_FIRE */
34 0.0, /* AT_ELECTRICITY */ 34 0.0, /* AT_ELECTRICITY */
35 0.0, /* AT_COLD */ 35 0.0, /* AT_COLD */
48 0.0, /* AT_DEATH */ 48 0.0, /* AT_DEATH */
49 0.0, /* AT_CHAOS */ 49 0.0, /* AT_CHAOS */
50 0.0 /* AT_COUNTERSPELL */ 50 0.0 /* AT_COUNTERSPELL */
51}; 51};
52 52
53float exp_prot_mult[NROFATTACKS + 2] = { 53static float exp_prot_mult[NROFATTACKS + 2] = {
54 0.4, /* AT_PHYSICAL */ 54 0.4, /* AT_PHYSICAL */
55 0.5, /* AT_MAGIC */ 55 0.5, /* AT_MAGIC */
56 0.1, /* AT_FIRE */ 56 0.1, /* AT_FIRE */
57 0.1, /* AT_ELECTRICITY */ 57 0.1, /* AT_ELECTRICITY */
58 0.1, /* AT_COLD */ 58 0.1, /* AT_COLD */
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 */
79static int
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