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

Comparing deliantra/server/server/gods.C (file contents):
Revision 1.45 by root, Thu Jan 1 16:05:13 2009 UTC vs.
Revision 1.49 by root, Sat Oct 17 21:40:38 2009 UTC

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,2007 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen 6 * Copyright (©) 1992,2007 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify 8 * Deliantra is free software: you can redistribute it and/or modify it under
9 * it under the terms of the GNU General Public License as published by 9 * the terms of the Affero GNU General Public License as published by the
10 * the Free Software Foundation, either version 3 of the License, or 10 * Free Software Foundation, either version 3 of the License, or (at your
11 * (at your option) any later version. 11 * option) any later version.
12 * 12 *
13 * This program is distributed in the hope that it will be useful, 13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the Affero GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 * and the GNU General Public License along with this program. If not, see
20 * <http://www.gnu.org/licenses/>.
20 * 21 *
21 * The authors can be reached via e-mail to <support@deliantra.net> 22 * The authors can be reached via e-mail to <support@deliantra.net>
22 */ 23 */
23 24
24/* Oct 3, 1995 - Code laid down for initial gods, priest alignment, and 25/* Oct 3, 1995 - Code laid down for initial gods, priest alignment, and
102 /* find a random god */ 103 /* find a random god */
103 if (!op->title) 104 if (!op->title)
104 { 105 {
105 int godnr = rndm (1, first_god->id); 106 int godnr = rndm (1, first_god->id);
106 107
107 for (godlink *gl = first_god; gl && gl->id != godnr; gl = gl->next) 108 for (godlink *gl = first_god; gl; gl = gl->next)
108 if (gl->id == godnr) 109 if (gl->id == godnr)
109 { 110 {
110 op->title = gl->name; 111 op->title = gl->name;
111 break; 112 break;
112 } 113 }
242 if (!pl_god) 243 if (!pl_god)
243 { /*new convert */ 244 { /*new convert */
244 become_follower (pl, altar->other_arch); 245 become_follower (pl, altar->other_arch);
245 return; 246 return;
246 } 247 }
247 else if (!strcmp (&pl_god->name, altar->other_arch->object::name)) 248 else if (pl_god->name == altar->other_arch->object::name)
248 { 249 {
249 /* pray at your gods altar */ 250 /* pray at your gods altar */
251 /* this leads to very low levels of wis and pray to result in no doubling! */
250 int bonus = (pl->stats.Wis + skill->level) / 10; 252 int bonus = (pl->stats.Wis + skill->level) / 10;
251 253
252 /* we can get neg grace up faster */ 254 /* we can get neg grace up faster */
253 if (pl->stats.grace < 0) 255 if (pl->stats.grace < 0)
254 pl->stats.grace += (bonus > -1 * (pl->stats.grace / 10) ? bonus : -1 * (pl->stats.grace / 10)); 256 pl->stats.grace += (bonus > -1 * (pl->stats.grace / 10) ? bonus : -1 * (pl->stats.grace / 10));
260 pl->stats.grace = 2 * pl->stats.maxgrace; 262 pl->stats.grace = 2 * pl->stats.maxgrace;
261 263
262 /* Every once in a while, the god decides to checkup on their 264 /* Every once in a while, the god decides to checkup on their
263 * follower, and may intervene to help them out. 265 * follower, and may intervene to help them out.
264 */ 266 */
265 bonus = MAX (1, bonus + MAX (pl->stats.luck, -3)); /* -- DAMN -- */ 267 bonus = max (1, bonus + max (pl->stats.luck, -3)); /* -- DAMN -- */
266 268
267 if (((random_roll (0, 399, pl, PREFER_LOW)) - bonus) < 0) 269 if (((random_roll (0, 399, pl, PREFER_LOW)) - bonus) < 0)
268 god_intervention (pl, pl_god, skill); 270 god_intervention (pl, pl_god, skill);
269 } 271 }
270 else 272 else
423 follower_remove_similar_item (op, tr->item); 425 follower_remove_similar_item (op, tr->item);
424 426
425 if (!op || !new_god) 427 if (!op || !new_god)
426 return; 428 return;
427 429
428 if (op->race && new_god->slaying && op->race.contains (new_god->slaying)) 430 if (new_god->slaying && op->race.contains (new_god->slaying))
429 { 431 {
430 new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "Fool! %s detests your kind!", &new_god->name); 432 new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "Fool! %s detests your kind!", &new_god->name);
431 433
432 if (random_roll (0, op->level - 1, op, PREFER_LOW) - 5 > 0) 434 if (random_roll (0, op->level - 1, op, PREFER_LOW) - 5 > 0)
433 { 435 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines